Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Curioni <maxime.curioni@gmail.com>2008-05-10 03:06:28 +0400
committerMaxime Curioni <maxime.curioni@gmail.com>2008-05-10 03:06:28 +0400
commitfd9ad582983939741a4c4fa5f2707f29365d6c09 (patch)
treed8817227d5b5687af533316e18b4db40512884e6 /source/blender/freestyle/intern/view_map
parent64e4a3ec9aed6c8abe095e2cd1fe1552f7cde51c (diff)
soc-2008-mxcurioni: towards Freestyle compilation, removing Qt's QString and QImage dependencies. Up to this commit, the following directories compile well (and without any warning): system, image, geometry, graph, winged_edge, view_map, stroke.
Modified code is commented by //soc and unused variables by //soc unused
Diffstat (limited to 'source/blender/freestyle/intern/view_map')
-rwxr-xr-xsource/blender/freestyle/intern/view_map/FEdgeXDetector.cpp3
-rwxr-xr-xsource/blender/freestyle/intern/view_map/FEdgeXDetector.h2
-rwxr-xr-xsource/blender/freestyle/intern/view_map/Interface0D.h2
-rwxr-xr-xsource/blender/freestyle/intern/view_map/Interface1D.h1
-rwxr-xr-xsource/blender/freestyle/intern/view_map/Silhouette.h2
-rwxr-xr-xsource/blender/freestyle/intern/view_map/SteerableViewMap.cpp41
-rwxr-xr-xsource/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp4
-rwxr-xr-xsource/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h15
-rwxr-xr-xsource/blender/freestyle/intern/view_map/ViewMapIO.cpp2
9 files changed, 49 insertions, 23 deletions
diff --git a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
index 628b3ad77aa..d9caee85e18 100755
--- a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
+++ b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
@@ -143,7 +143,8 @@ void FEdgeXDetector::computeCurvatures(WXVertex *vertex){
// CURVATURE LAYER
// store all the curvature datas for each vertex
- real K1, K2, cos2theta, sin2theta;
+ //soc unused - real K1, K2
+ real cos2theta, sin2theta;
Vec3r e1, n, v;
// one vertex curvature info :
CurvatureInfo *C;
diff --git a/source/blender/freestyle/intern/view_map/FEdgeXDetector.h b/source/blender/freestyle/intern/view_map/FEdgeXDetector.h
index 38d0f34e21f..a6235dd53b5 100755
--- a/source/blender/freestyle/intern/view_map/FEdgeXDetector.h
+++ b/source/blender/freestyle/intern/view_map/FEdgeXDetector.h
@@ -126,7 +126,7 @@ protected:
Vec3r _Viewpoint;
real _bbox_diagonal; // diagonal of the current processed shape bbox
- //tmp values
+ //oldtmp values
bool _computeViewIndependant;
real _meanK1;
real _meanKr;
diff --git a/source/blender/freestyle/intern/view_map/Interface0D.h b/source/blender/freestyle/intern/view_map/Interface0D.h
index eec39d2f7bc..fd2e882e9b6 100755
--- a/source/blender/freestyle/intern/view_map/Interface0D.h
+++ b/source/blender/freestyle/intern/view_map/Interface0D.h
@@ -52,6 +52,8 @@ class TVertex;
class Interface0D
{
public:
+
+ virtual ~Interface0D() {}; //soc
/*! Returns the string "Interface0D".*/
virtual string getExactTypeName() const {
diff --git a/source/blender/freestyle/intern/view_map/Interface1D.h b/source/blender/freestyle/intern/view_map/Interface1D.h
index 812187e5ec1..96dd94c36f9 100755
--- a/source/blender/freestyle/intern/view_map/Interface1D.h
+++ b/source/blender/freestyle/intern/view_map/Interface1D.h
@@ -127,6 +127,7 @@ public:
/*! Default constructor */
Interface1D() {_timeStamp=0;}
+ virtual ~Interface1D() {}; //soc
/*! Returns the string "Interface1D" .*/
virtual string getExactTypeName() const {
diff --git a/source/blender/freestyle/intern/view_map/Silhouette.h b/source/blender/freestyle/intern/view_map/Silhouette.h
index e88bf23b210..958c0545d6d 100755
--- a/source/blender/freestyle/intern/view_map/Silhouette.h
+++ b/source/blender/freestyle/intern/view_map/Silhouette.h
@@ -1248,7 +1248,7 @@ public:
*/
inline FEdge* SplitEdgeIn2(FEdge* ioEdge, SVertex * ioNewVertex)
{
- SVertex *A = ioEdge->vertexA();
+ //soc unused - SVertex *A = ioEdge->vertexA();
SVertex *B = ioEdge->vertexB();
diff --git a/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp b/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp
index b2604606aa7..3870edc2b75 100755
--- a/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp
+++ b/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp
@@ -26,8 +26,12 @@
#include "../geometry/Geom.h"
using namespace Geometry;
-#include <qstring.h>
-#include <qimage.h>
+//soc #include <qstring.h>
+//soc #include <qimage.h>
+#include <sstream>
+#include "IMB_imbuf.h"
+#include "IMB_imbuf_types.h"
+#include "intern/IMB_png.h"
SteerableViewMap::SteerableViewMap(unsigned int nbOrientations){
_nbOrientations = nbOrientations;
@@ -121,7 +125,7 @@ double * SteerableViewMap::AddFEdge(FEdge *iFEdge){
unsigned SteerableViewMap::getSVMNumber(const Vec2f& orient){
Vec2f dir(orient);
- unsigned res = 0;
+ //soc unsigned res = 0;
real norm = dir.norm();
if(norm < 1e-6){
return _nbOrientations+1;
@@ -205,20 +209,37 @@ void SteerableViewMap::saveSteerableViewMap() const {
}
int ow = _imagesPyramids[i]->width(0);
int oh = _imagesPyramids[i]->height(0);
- QString base("SteerableViewMap");
- for(unsigned j=0; j<_imagesPyramids[i]->getNumberOfLevels(); ++j){
+
+ //soc QString base("SteerableViewMap");
+ string base("SteerableViewMap");
+ stringstream filename;
+
+ for(int j=0; j<_imagesPyramids[i]->getNumberOfLevels(); ++j){ //soc
float coeff = 1;//1/255.f; //100*255;//*pow(2,j);
- QImage qtmp(ow, oh, QImage::Format_RGB32);
- for(unsigned y=0;y<oh;++y){
- for(unsigned x=0;x<ow;++x){
+ //soc QImage qtmp(ow, oh, QImage::Format_RGB32);
+ ImBuf *ibuf = IMB_allocImBuf(ow, oh, 32, IB_rect, 0);
+ int rowbytes = ow*4;
+ char *pix;
+
+ for(int y=0;y<oh;++y){ //soc
+ for(int x=0;x<ow;++x){ //soc
int c = (int)(coeff*_imagesPyramids[i]->pixel(x,y,j));
if(c>255)
c=255;
//int c = (int)(_imagesPyramids[i]->pixel(x,y,j));
- qtmp.setPixel(x,y,qRgb(c,c,c));
+
+ //soc qtmp.setPixel(x,y,qRgb(c,c,c));
+ pix = (char*)ibuf->rect + y*rowbytes + x*4;
+ pix[0] = pix [1] = pix[2] = c;
}
}
- qtmp.save(base+QString::number(i)+"-"+QString::number(j)+".png", "PNG");
+
+ //soc qtmp.save(base+QString::number(i)+"-"+QString::number(j)+".png", "PNG");
+ filename << base;
+ filename << i << "-" << j << ".png";
+
+ imb_savepng(ibuf, const_cast<char *>(filename.str().c_str()), 0);
+
}
// QString base("SteerableViewMap");
// for(unsigned j=0; j<_imagesPyramids[i]->getNumberOfLevels(); ++j){
diff --git a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
index 20b3aeb144d..bf4369bcf41 100755
--- a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
@@ -169,7 +169,7 @@ ViewEdge * ViewEdgeXBuilder::BuildSmoothViewEdge(const OWXFaceLayer& iFaceLayer)
// build FEdges
FEdge * feprevious = 0;
FEdge * fefirst = 0;
- FEdge * fe;
+ FEdge * fe = 0;
for(list<OWXFaceLayer>::iterator fl = facesChain.begin(), flend=facesChain.end();
fl!=flend;
++fl){
@@ -243,7 +243,7 @@ ViewEdge * ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge& iWEdge) {
// build FEdges
FEdge * feprevious = 0;
FEdge * fefirst = 0;
- FEdge * fe;
+ FEdge * fe = 0;
for(list<OWXEdge>::iterator we = edgesChain.begin(), weend=edgesChain.end();
we!=weend;
++we){
diff --git a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h
index 9e2837b49a7..da63fa2f515 100755
--- a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h
+++ b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h
@@ -35,12 +35,13 @@
# include <utility>
# include <vector>
-# if defined(__GNUC__) && (__GNUC__ >= 3)
-//hash_map is not part of the C++ standard anymore; hash_map.h has been kept though for backward compatibility
-# include <hash_map.h>
-# else
-# include <hash_map>
-# endif
+// soc
+// # if defined(__GNUC__) && (__GNUC__ >= 3)
+// //hash_map is not part of the C++ standard anymore; hash_map.h has been kept though for backward compatibility
+// # include <hash_map.h>
+// # else
+// # include <hash_map>
+// # endif
# include "../system/FreestyleConfig.h"
# include "../geometry/Geom.h"
@@ -202,7 +203,7 @@ protected:
/*! instanciate a ViewVertex from a SVertex, if it doesn't exist yet */
ViewVertex * MakeViewVertex(SVertex *iSVertex);
- //tmp values
+ //oldtmp values
// IdHashTable _hashtable;
// VVIdHashTable _multivertexHashTable;
SVertexMap _SVertexMap;
diff --git a/source/blender/freestyle/intern/view_map/ViewMapIO.cpp b/source/blender/freestyle/intern/view_map/ViewMapIO.cpp
index d68164973a1..4e2796113c8 100755
--- a/source/blender/freestyle/intern/view_map/ViewMapIO.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMapIO.cpp
@@ -937,7 +937,7 @@ namespace ViewMapIO {
if (!vm)
return 1;
- unsigned tmp;
+ //soc unused - unsigned tmp;
int err = 0;