Another big code clean-up patch from Bastien Montagne, thanks again!
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Mon, 11 Mar 2013 06:56:51 +0000 (06:56 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Mon, 11 Mar 2013 06:56:51 +0000 (06:56 +0000)
74 files changed:
source/blender/freestyle/intern/scene_graph/IndexedFaceSet.cpp
source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h
source/blender/freestyle/intern/scene_graph/Node.h
source/blender/freestyle/intern/scene_graph/NodeGroup.h
source/blender/freestyle/intern/scene_graph/OrientedLineRep.h
source/blender/freestyle/intern/scene_graph/Rep.h
source/blender/freestyle/intern/stroke/AdvancedFunctions0D.cpp
source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp
source/blender/freestyle/intern/stroke/AdvancedFunctions1D.h
source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp
source/blender/freestyle/intern/stroke/BasicStrokeShaders.h
source/blender/freestyle/intern/stroke/Canvas.cpp
source/blender/freestyle/intern/stroke/Canvas.h
source/blender/freestyle/intern/stroke/Chain.cpp
source/blender/freestyle/intern/stroke/Chain.h
source/blender/freestyle/intern/stroke/ChainingIterators.cpp
source/blender/freestyle/intern/stroke/ChainingIterators.h
source/blender/freestyle/intern/stroke/ContextFunctions.cpp
source/blender/freestyle/intern/stroke/Curve.cpp
source/blender/freestyle/intern/stroke/Curve.h
source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h
source/blender/freestyle/intern/stroke/CurveIterators.h
source/blender/freestyle/intern/stroke/Module.h
source/blender/freestyle/intern/stroke/Operators.cpp
source/blender/freestyle/intern/stroke/PSStrokeRenderer.cpp
source/blender/freestyle/intern/stroke/PSStrokeRenderer.h
source/blender/freestyle/intern/stroke/Predicates1D.h
source/blender/freestyle/intern/stroke/Stroke.cpp
source/blender/freestyle/intern/stroke/Stroke.h
source/blender/freestyle/intern/stroke/StrokeAdvancedIterators.h
source/blender/freestyle/intern/stroke/StrokeIO.cpp
source/blender/freestyle/intern/stroke/StrokeIterators.h
source/blender/freestyle/intern/stroke/StrokeRenderer.cpp
source/blender/freestyle/intern/stroke/StrokeRenderer.h
source/blender/freestyle/intern/stroke/StrokeRep.cpp
source/blender/freestyle/intern/stroke/StrokeRep.h
source/blender/freestyle/intern/stroke/StrokeTesselator.cpp
source/blender/freestyle/intern/stroke/TextStrokeRenderer.cpp
source/blender/freestyle/intern/stroke/TextStrokeRenderer.h
source/blender/freestyle/intern/system/FreestyleConfig.h
source/blender/freestyle/intern/system/RenderMonitor.h
source/blender/freestyle/intern/view_map/BoxGrid.cpp
source/blender/freestyle/intern/view_map/BoxGrid.h
source/blender/freestyle/intern/view_map/CulledOccluderSource.cpp
source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
source/blender/freestyle/intern/view_map/FEdgeXDetector.h
source/blender/freestyle/intern/view_map/Functions0D.cpp
source/blender/freestyle/intern/view_map/Functions1D.cpp
source/blender/freestyle/intern/view_map/GridDensityProvider.h
source/blender/freestyle/intern/view_map/Interface0D.h
source/blender/freestyle/intern/view_map/OccluderSource.cpp
source/blender/freestyle/intern/view_map/Silhouette.cpp
source/blender/freestyle/intern/view_map/Silhouette.h
source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.h
source/blender/freestyle/intern/view_map/SphericalGrid.cpp
source/blender/freestyle/intern/view_map/SphericalGrid.h
source/blender/freestyle/intern/view_map/SteerableViewMap.cpp
source/blender/freestyle/intern/view_map/SteerableViewMap.h
source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h
source/blender/freestyle/intern/view_map/ViewMap.cpp
source/blender/freestyle/intern/view_map/ViewMap.h
source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h
source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
source/blender/freestyle/intern/view_map/ViewMapIO.cpp
source/blender/freestyle/intern/view_map/ViewMapIO.h
source/blender/freestyle/intern/winged_edge/Curvature.cpp
source/blender/freestyle/intern/winged_edge/WEdge.cpp
source/blender/freestyle/intern/winged_edge/WEdge.h
source/blender/freestyle/intern/winged_edge/WXEdge.cpp
source/blender/freestyle/intern/winged_edge/WXEdge.h
source/blender/freestyle/intern/winged_edge/WXEdgeBuilder.cpp
source/blender/freestyle/intern/winged_edge/WXEdgeBuilder.h
source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp

index f373b730d0fc364520fae3cd94019d28d3a4fceb..20c33713db4945ffdf3b23b48fe3168848c994d4 100644 (file)
@@ -231,8 +231,7 @@ IndexedFaceSet::~IndexedFaceSet()
                _Vertices = NULL;
        }
 
-       if (NULL != _Normals)
-       {
+       if (NULL != _Normals) {
                delete[] _Normals;
                _Normals = NULL;
        }
index 6ec769f4cafd8193b2ea4ba27ff68bb8e58c1af2..c2715812eeeaf4fcf46964246215ead7c4c197ac 100644 (file)
@@ -185,12 +185,12 @@ public:
        }
 
        /*! Accessors */
-       virtual const real * vertices() const
+       virtual const real *vertices() const
        {
                return _Vertices;
        }
 
-       virtual const real * normals() const
+       virtual const real *normals() const
        {
                return _Normals;
        }
@@ -200,7 +200,7 @@ public:
                return _FrsMaterials;
        }
 
-       virtual const realtexCoords() const
+       virtual const real *texCoords() const
        {
                return _TexCoords;
        }
@@ -230,37 +230,37 @@ public:
                return _NumFaces;
        }
 
-       virtual const unsigned * numVertexPerFaces() const
+       virtual const unsigned *numVertexPerFaces() const
        {
                return _NumVertexPerFace;
        }
 
-       virtual const TRIANGLES_STYLE * trianglesStyle() const
+       virtual const TRIANGLES_STYLE *trianglesStyle() const
        {
                return _FaceStyle;
        }
 
-       virtual const unsigned char * faceEdgeMarks() const
+       virtual const unsigned char *faceEdgeMarks() const
        {
                return _FaceEdgeMarks;
        }
 
-       virtual const unsignedvindices() const
+       virtual const unsigned *vindices() const
        {
                return _VIndices;
        }
 
-       virtual const unsignednindices() const
+       virtual const unsigned *nindices() const
        {
                return _NIndices;
        }
 
-       virtual const unsignedmindices() const
+       virtual const unsigned *mindices() const
        {
                return _MIndices;
        }
 
-       virtual const unsignedtindices() const
+       virtual const unsigned *tindices() const
        {
                return _TIndices;
        }
index 626a09132335e0fec75287301f6264c39d366f3f..03e9343f7e78fb2bd6582740726f556f30d873c4 100644 (file)
@@ -57,7 +57,7 @@ public:
                _BBox = iBrother.bbox();
        }
 
-       virtual ~Node(){}
+       virtual ~Node() {}
 
        /*! Accept the corresponding visitor
         *  Each inherited node must overload this method
@@ -85,10 +85,10 @@ public:
        /*! Makes the union of _BBox and iBox */
        virtual void AddBBox(const BBox<Vec3r>& iBox)
        {
-               if(iBox.empty())
+               if (iBox.empty())
                        return;
 
-               if(_BBox.empty())
+               if (_BBox.empty())
                        _BBox = iBox;
                else
                        _BBox += iBox;
index 1c5b106d5c6386ad9ef43c7628986fdfc4c452b4..aed9562903e9cc6d9861c73431e293da5b829442 100644 (file)
@@ -48,7 +48,7 @@ class LIB_SCENE_GRAPH_EXPORT NodeGroup : public Node
 {
 public:
        inline NodeGroup(): Node() {}
-       virtual ~NodeGroup(){}
+       virtual ~NodeGroup() {}
 
        /*! Adds a child. Makes a addRef on the iChild reference counter */
        virtual void AddChild(Node *iChild);
index 45cda3610f225b02c24d5f661cdb5f9b58bb57cf..28b620f5c80f92daf2170d48ae2e25d2c745bcd7 100644 (file)
@@ -49,7 +49,7 @@ public:
         *  v2
         *    second vertex
         */
-       inline OrientedLineRep(const Vec3r& v1, const Vec3r& v2) : LineRep(v1,v2) {}
+       inline OrientedLineRep(const Vec3r& v1, const Vec3r& v2) : LineRep(v1, v2) {}
 
        /*! Builds a line rep from a vertex chain */
        inline OrientedLineRep(const vector<Vec3r>& vertices) : LineRep(vertices) {}
index c1b29d3fceb3000e11449e2c85dbe182745d04da..055ec0674f88b85b2068836463e73f43b2f3af74 100644 (file)
@@ -70,10 +70,10 @@ public:
 
        inline void swap(Rep& ioOther)
        {
-               std::swap(_BBox,ioOther._BBox);
+               std::swap(_BBox, ioOther._BBox);
                std::swap(_Id, ioOther._Id);
                std::swap(_Name, ioOther._Name);
-               std::swap(_FrsMaterial,ioOther._FrsMaterial);
+               std::swap(_FrsMaterial, ioOther._FrsMaterial);
        }
 
        Rep& operator=(const Rep& iBrother)
@@ -137,7 +137,7 @@ public:
                return _Name;
        }
 
-       inline const FrsMaterial * frs_material() const
+       inline const FrsMaterial *frs_material() const
        {
                return _FrsMaterial;
        }
index 9d955722ac71667ecac7e6ee24a10b3d63bd8a4f..25b5bdb26dc7ab9473945cd144636da044bcdf4f 100644 (file)
@@ -43,11 +43,12 @@ namespace Functions0D {
 
 int DensityF0D::operator()(Interface0DIterator& iter)
 {
-       Canvascanvas = Canvas::getInstance();
+       Canvas *canvas = Canvas::getInstance();
        int bound = _filter.getBound();
 
-       if ((iter->getProjectedX()-bound < 0) || (iter->getProjectedX()+bound>canvas->width()) ||
-           (iter->getProjectedY()-bound < 0) || (iter->getProjectedY()+bound>canvas->height())) {
+       if ((iter->getProjectedX() - bound < 0) || (iter->getProjectedX() + bound>canvas->width()) ||
+           (iter->getProjectedY() - bound < 0) || (iter->getProjectedY() + bound>canvas->height()))
+       {
                result = 0.0;
                return 0;
        }
@@ -63,17 +64,18 @@ int DensityF0D::operator()(Interface0DIterator& iter)
 
 int LocalAverageDepthF0D::operator()(Interface0DIterator& iter)
 {
-       Canvas * iViewer = Canvas::getInstance();
+       Canvas *iViewer = Canvas::getInstance();
        int bound = _filter.getBound();
 
-       if ((iter->getProjectedX()-bound < 0) || (iter->getProjectedX()+bound>iViewer->width()) ||
-           (iter->getProjectedY()-bound < 0) || (iter->getProjectedY()+bound>iViewer->height())) {
+       if ((iter->getProjectedX() - bound < 0) || (iter->getProjectedX() + bound>iViewer->width()) ||
+           (iter->getProjectedY() - bound < 0) || (iter->getProjectedY() + bound>iViewer->height()))
+       {
                result = 0.0;
                return 0;
        }
 
        GrayImage image;
-       iViewer->readDepthPixels((int)iter->getProjectedX() - bound, (int)iter->getProjectedY()-bound,
+       iViewer->readDepthPixels((int)iter->getProjectedX() - bound, (int)iter->getProjectedY() - bound,
                                 _filter.maskSize(), _filter.maskSize(), image);
        result = _filter.getSmoothedPixel(&image, (int)iter->getProjectedX(), (int)iter->getProjectedY());
 
@@ -82,7 +84,7 @@ int LocalAverageDepthF0D::operator()(Interface0DIterator& iter)
 
 int ReadMapPixelF0D::operator()(Interface0DIterator& iter)
 {
-       Canvas * canvas = Canvas::getInstance();
+       Canvas *canvas = Canvas::getInstance();
        result = canvas->readMapPixel(_mapName, _level, (int)iter->getProjectedX(), (int)iter->getProjectedY());
        return 0;
 }
@@ -98,7 +100,7 @@ int ReadSteerableViewMapPixelF0D::operator()(Interface0DIterator& iter)
 int ReadCompleteViewMapPixelF0D::operator()(Interface0DIterator& iter)
 {
        SteerableViewMap *svm = Canvas::getInstance()->getSteerableViewMap();
-       result = svm->readCompleteViewMapPixel(_level,(int)iter->getProjectedX(), (int)iter->getProjectedY());
+       result = svm->readCompleteViewMapPixel(_level, (int)iter->getProjectedX(), (int)iter->getProjectedY());
        return 0;
 }
 
@@ -106,10 +108,10 @@ int GetViewMapGradientNormF0D::operator()(Interface0DIterator& iter)
 {
        SteerableViewMap *svm = Canvas::getInstance()->getSteerableViewMap();
        float pxy = svm->readCompleteViewMapPixel(_level, (int)iter->getProjectedX(), (int)iter->getProjectedY());
-       float gx = svm->readCompleteViewMapPixel(_level, (int)iter->getProjectedX() + _step, (int)iter->getProjectedY())
-                  - pxy;
-       float gy = svm->readCompleteViewMapPixel(_level, (int)iter->getProjectedX(), (int)iter->getProjectedY() + _step)
-                  - pxy;
+       float gx = svm->readCompleteViewMapPixel(_level, (int)iter->getProjectedX() + _step,
+                                                (int)iter->getProjectedY()) - pxy;
+       float gy = svm->readCompleteViewMapPixel(_level, (int)iter->getProjectedX(),
+                                                (int)iter->getProjectedY() + _step) - pxy;
        result = Vec2f(gx, gy).norm();
        return 0;
 }
index 2df4d19195ee3a94bcf4f87b3c94d77f1f736dc0..e07afb2566e4f9426b2afc06adbed6624ac8154a 100644 (file)
@@ -43,7 +43,7 @@ namespace Functions1D {
 
 int GetSteerableViewMapDensityF1D::operator()(Interface1D& inter)
 {
-       SteerableViewMap * svm = Canvas::getInstance()->getSteerableViewMap();
+       SteerableViewMap *svm = Canvas::getInstance()->getSteerableViewMap();
        Interface0DIterator it = inter.pointsBegin(_sampling);
        Interface0DIterator itnext = it;
        ++itnext;
@@ -56,8 +56,8 @@ int GetSteerableViewMapDensityF1D::operator()(Interface1D& inter)
                Interface0D& i0Dnext = (*itnext);
                fe = i0D.getFEdge(i0Dnext);
                if (fe == 0) {
-                       cerr << "GetSteerableViewMapDensityF1D warning: no FEdge between " << i0D.getId() << " and "
-                            << i0Dnext.getId() << endl;
+                       cerr << "GetSteerableViewMapDensityF1D warning: no FEdge between " << i0D.getId() << " and " <<
+                               i0Dnext.getId() << endl;
                        // compute the direction between these two ???
                        Vec2f dir = i0Dnext.getPoint2D() - i0D.getPoint2D();
                        nSVM = svm->getSVMNumber(dir);
index 35f516cd781e1ccb4b6106bd07c2bf68de88cfda..8373450d440efb997dbc5260bcd3f5ba04449f12 100644 (file)
@@ -64,8 +64,9 @@ public:
         *  \param iType
         *    The integration method used to compute a single value from a set of values.
         *  \param sampling
-        *    The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and the
-        *    result is obtained by combining the resulting values into a single one, following the method specified by iType.
+        *    The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
+        *    the result is obtained by combining the resulting values into a single one, following the method specified
+        *    by iType.
         */
        DensityF1D(double sigma = 2, IntegrationType iType = MEAN, float sampling = 2.0f)
        : UnaryFunction1D<double>(iType), _fun(sigma)
@@ -187,8 +188,9 @@ public:
         *  \param iType
         *    The integration method used to compute a single value from a set of values.
         *  \param sampling
-        *    The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and the
-        *    result is obtained by combining the resulting values into a single one, following the method specified by iType.
+        *    The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
+        *    the result is obtained by combining the resulting values into a single one, following the method specified
+        *    by iType.
         */
        GetDirectionalViewMapDensityF1D(unsigned iOrientation, unsigned level, IntegrationType iType = MEAN,
                                        float sampling = 2.0f)
@@ -228,10 +230,11 @@ public:
         *  \param iType
         *    The integration method used to compute a single value from a set of values.
         *  \param sampling
-        *    The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and the
-        *    result is obtained by combining the resulting values into a single one, following the method specified by iType.
+        *    The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
+        *    the result is obtained by combining the resulting values into a single one, following the method specified
+        *    by iType.
         */
-       GetSteerableViewMapDensityF1D(int level,IntegrationType iType = MEAN, float sampling = 2.0f)
+       GetSteerableViewMapDensityF1D(int level, IntegrationType iType = MEAN, float sampling = 2.0f)
        : UnaryFunction1D<real>(iType)
        {
                _level = level;
@@ -269,10 +272,11 @@ public:
         *  \param iType
         *    The integration method used to compute a single value from a set of values.
         *  \param sampling
-        *    The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and the
-        *    result is obtained by combining the resulting values into a single one, following the method specified by iType.
+        *    The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
+        *    the result is obtained by combining the resulting values into a single one, following the method specified
+        *    by iType.
         */
-       GetViewMapGradientNormF1D(int level,IntegrationType iType = MEAN, float sampling = 2.0f)
+       GetViewMapGradientNormF1D(int level, IntegrationType iType = MEAN, float sampling = 2.0f)
        : UnaryFunction1D<real>(iType), _func(level)
        {
                _level = level;
index a083c6b2f1b82af19a85030bfa73587c11ea6cee..7aa66841859060bff3e36830cd304ca72df1642f 100644 (file)
@@ -79,7 +79,7 @@ static void convert(ImBuf *imBuf, float **oArray, unsigned &oSize)
 
        char *pix;
        for (unsigned int i = 0; i < oSize; ++i) {
-               pix = (char*) imBuf->rect + i * 4;
+               pix = (char *) imBuf->rect + i * 4;
                (*oArray)[i] = ((float) pix[2]) / 255.0f;
        }
 }
@@ -146,7 +146,7 @@ int IncreasingThicknessShader::shade(Stroke& stroke) const
 int ConstrainedIncreasingThicknessShader::shade(Stroke& stroke) const
 {
        float slength = stroke.getLength2D();
-       float maxT = min(_ratio*slength,_ThicknessMax);
+       float maxT = min(_ratio * slength, _ThicknessMax);
        int n = stroke.strokeVerticesSize() - 1, i;
        StrokeInternal::StrokeVertexIterator v, vend;
        for (i = 0, v = stroke.strokeVerticesBegin(), vend = stroke.strokeVerticesEnd();
@@ -233,7 +233,7 @@ int ThicknessVariationPatternShader::shade(Stroke& stroke) const
        int vert_size = stroke.strokeVerticesSize();
        int sig = 0;
        unsigned index;
-       const floatoriginalThickness;
+       const float *originalThickness;
        for (v = stroke.strokeVerticesBegin(), vend = stroke.strokeVerticesEnd(); v != vend; ++v) {
                originalThickness = v->attribute().getThickness();
                if (_stretch) {
@@ -248,13 +248,13 @@ int ThicknessVariationPatternShader::shade(Stroke& stroke) const
                index %= _size;
                float thicknessR = array[index] * originalThickness[0];
                float thicknessL = array[index] * originalThickness[1];
-               if (thicknessR+thicknessL < _minThickness) {
-                       thicknessL = _minThickness/2.0f;
-                       thicknessR = _minThickness/2.0f;
+               if (thicknessR + thicknessL < _minThickness) {
+                       thicknessL = _minThickness / 2.0f;
+                       thicknessR = _minThickness / 2.0f;
                }
-               if (thicknessR+thicknessL > _maxThickness) {
-                       thicknessL = _maxThickness/2.0f;
-                       thicknessR = _maxThickness/2.0f;
+               if (thicknessR + thicknessL > _maxThickness) {
+                       thicknessL = _maxThickness / 2.0f;
+                       thicknessR = _maxThickness / 2.0f;
                }
                if ((sig == 0) || (sig == vert_size - 1))
                        v->attribute().setThickness(1, 1);
@@ -564,9 +564,9 @@ int BackboneStretcherShader::shade(Stroke& stroke) const
        Vec2d first((v0)->x(), (v0)->y());
        Vec2d last((vn)->x(), (vn)->y());
 
-       Vec2d d1(first-Vec2d((v1)->x(), (v1)->y()));
+       Vec2d d1(first - Vec2d((v1)->x(), (v1)->y()));
        d1.normalize();
-       Vec2d dn(last-Vec2d((vn_1)->x(), (vn_1)->y()));
+       Vec2d dn(last - Vec2d((vn_1)->x(), (vn_1)->y()));
        dn.normalize();
 
        Vec2d newFirst(first + _amount * d1);
@@ -590,7 +590,7 @@ int ExternalContourStretcherShader::shade(Stroke& stroke) const
        //float l = stroke.getLength2D();
        Interface0DIterator it;
        Functions0D::Normal2DF0D fun;
-       StrokeVertexsv;
+       StrokeVertex *sv;
        for (it = stroke.verticesBegin(); !it.isEnd(); ++it) {
                if (fun(it) < 0)
                        return -1;
@@ -900,7 +900,7 @@ int InflateShader::shade(Stroke& stroke) const
                if (norm_fun(stroke) < 0)
                        return -1;
                Vec2f strokeN(norm_fun.result);
-               if (n*strokeN < 0) {
+               if (n * strokeN < 0) {
                        n[0] = -n[0];
                        n[1] = -n[1];
                }
index 58647861390b52f8b0d0e6b2e58caac19c7c5bd1..976672117298c397bace587d4a11178178867225 100644 (file)
@@ -875,7 +875,7 @@ public:
        /*! Builds the shader from the output file name */
        fstreamShader(const char *iFileName) : StrokeShader()
        {
-               _stream .open(iFileName);
+               _stream.open(iFileName);
                if (!_stream.is_open()) {
                        cerr << "couldn't open file " << iFileName << endl;
                }
index 3fd2f9252d9d96c0201527a0c216f8d01e8cc5b5..ddcf83b06168efd7c260a13e0bb73e17d04e1f01 100644 (file)
@@ -182,7 +182,7 @@ void Canvas::Erase()
 
 void Canvas::PushBackStyleModule(StyleModule *iStyleModule)
 {
-       StrokeLayerlayer = new StrokeLayer();
+       StrokeLayer *layer = new StrokeLayer();
        _StyleModules.push_back(iStyleModule);
        _Layers.push_back(layer);
 }
@@ -313,7 +313,7 @@ void Canvas::loadMap(const char *iFileName, const char *iMapName, unsigned int i
                mapsMap::iterator m = _maps.find(iMapName);
                if (m != _maps.end()) {
                        // lazy check for size changes
-                       ImagePyramid * pyramid = (*m).second;
+                       ImagePyramid *pyramid = (*m).second;
                        if ((pyramid->width() != width()) || (pyramid->height() != height())) {
                                delete pyramid;
                        }
@@ -389,7 +389,7 @@ void Canvas::loadMap(const char *iFileName, const char *iMapName, unsigned int i
 
        for (y = 0; y < h; ++y) {
                for (x = 0; x < w; ++x) {
-                       pix = (char*)qimg->rect + y * rowbytes + x * 4;
+                       pix = (char *)qimg->rect + y * rowbytes + x * 4;
                        float c = (pix[0] * 11 + pix[1] * 16 + pix[2] * 5) / 32;
                        tmp.setPixel(x, y, c);
                }
@@ -426,8 +426,8 @@ void Canvas::loadMap(const char *iFileName, const char *iMapName, unsigned int i
                        for (x = 0; x < ow; ++x) {
                                int c = pyramid->pixel(x, y, i); // 255 * pyramid->pixel(x, y, i);
                                //soc qtmp.setPixel(x, y, qRgb(c, c, c));
-                               pix = (char*)qtmp->rect + y * rowbytes + x * 4;
-                               pix[0] = pix [1] = pix[2] = c;
+                               pix = (char *)qtmp->rect + y * rowbytes + x * 4;
+                               pix[0] = pix[1] = pix[2] = c;
                        }
                }
                //soc qtmp.save(base + QString::number(i) + ".bmp", "BMP");
index 9931bf3c97e68dd9f0dc60a26c60c6624b51f20a..a583381599f48bc908ecadb8e579eb9a7726017f 100644 (file)
@@ -51,7 +51,7 @@ using namespace Geometry;
 
 struct ltstr
 {
-       bool operator()(const char* s1, const char* s2) const
+       bool operator()(const char *s1, const char *s2) const
        {
                return strcmp(s1, s2) < 0;
        }
@@ -81,7 +81,7 @@ public:
                return _pInstance;
        }
 
-       typedef std::map<const char*, ImagePyramid*, ltstr> mapsMap;
+       typedef std::map<const char *, ImagePyramid *, ltstr> mapsMap;
        static const int NB_STEERABLE_VIEWMAP = 5;
 
 protected:
@@ -131,9 +131,9 @@ public:
        virtual void Erase(); 
 
        /* Reads a pixel area from the canvas */
-       virtual void readColorPixels(int x, int y,int w, int h, RGBImage& oImage) const = 0;
+       virtual void readColorPixels(int x, int y, int w, int h, RGBImage& oImage) const = 0;
        /* Reads a depth pixel area from the canvas */
-       virtual void readDepthPixels(int x, int y,int w, int h, GrayImage& oImage) const = 0;
+       virtual void readDepthPixels(int x, int y, int w, int h, GrayImage& oImage) const = 0;
 
        /* update the canvas (display) */
        virtual void update() = 0;
@@ -172,13 +172,13 @@ public:
        float readMapPixel(const char *iMapName, int level, int x, int y);
 
        /*! Sets the steerable viewmap */
-       void loadSteerableViewMap(SteerableViewMap * iSVM)
+       void loadSteerableViewMap(SteerableViewMap *iSVM)
        {
                _steerableViewMap = iSVM;
        }
 
        /*! Returns the steerable VM */
-       SteerableViewMap * getSteerableViewMap()
+       SteerableViewMap *getSteerableViewMap()
        {
                return _steerableViewMap;
        }
index 59cebbd5da011f32cc64bbd93c1e0b40f4989983..68ae8b7000378c05a3106ae1a3879d52f0896be9 100644 (file)
@@ -25,7 +25,7 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/freestyle/intern/stroke/Chain.h
+/** \file blender/freestyle/intern/stroke/Chain.cpp
  *  \ingroup freestyle
  *  \brief Class to define a chain of viewedges.
  *  \author Stephane Grabli
index 425761d28efdb78b3bd374b4ff30c5a7fbdf9b3f..688d55f1f0c9fbe9e616a396038b26c7db1eb39d 100644 (file)
@@ -46,7 +46,7 @@ class Chain : public Curve
 {
 protected:
        // tmp
-       Id * _splittingId;
+       Id *_splittingId;
        FEdge *_fedgeB; // the last FEdge of the ViewEdge passed to the last call for push_viewedge_back().
 
 public:
@@ -107,7 +107,7 @@ public:
                _splittingId = sid;
        }
 
-       inline IdgetSplittingId()
+       inline Id *getSplittingId()
        {
                return _splittingId;
        }
index 1883e494eab9ad69ca69b97f436a7767d8995b5b..ccf944a7fccaa19211864774fc5b443c3293c75b 100644 (file)
@@ -36,7 +36,7 @@
 
 #include "../system/TimeStamp.h"
 
-ViewEdgeAdjacencyIterator::operator*()
+ViewEdge *AdjacencyIterator::operator*()
 {
        return (*_internalIterator).first;
 }
@@ -49,12 +49,12 @@ bool AdjacencyIterator::isIncoming() const
 int AdjacencyIterator::increment()
 {
        ++_internalIterator;
-       while((!_internalIterator.isEnd()) && (!isValid((*_internalIterator).first)))
+       while ((!_internalIterator.isEnd()) && (!isValid((*_internalIterator).first)))
                ++_internalIterator;
        return 0;
 }
 
-bool AdjacencyIterator::isValid(ViewEdgeedge)
+bool AdjacencyIterator::isValid(ViewEdge *edge)
 {
        if (_restrictToSelection) {
                if (edge->getTimeStamp() != TimeStamp::instance()->getTimeStamp())
@@ -70,7 +70,7 @@ bool AdjacencyIterator::isValid(ViewEdge* edge)
 int ChainingIterator::increment()
 {
        _increment = true;
-       ViewVertex * vertex = getVertex();
+       ViewVertex *vertex = getVertex();
        if (!vertex) {
                _edge = 0;
                return 0;
@@ -83,9 +83,9 @@ int ChainingIterator::increment()
        if (traverse(it) < 0)
                return -1;
        _edge = result;
-       if(_edge == 0)
+       if (_edge == 0)
                return 0;
-       if(_edge->A() == vertex)
+       if (_edge->A() == vertex)
                _orientation = true;
        else
                _orientation = false;
@@ -95,7 +95,7 @@ int ChainingIterator::increment()
 int ChainingIterator::decrement()
 {
        _increment = false;
-       ViewVertex * vertex = getVertex();
+       ViewVertex *vertex = getVertex();
        if (!vertex) {
                _edge = 0;
                return 0;
@@ -108,9 +108,9 @@ int ChainingIterator::decrement()
        if (traverse(it) < 0)
                return -1;
        _edge = result;
-       if(_edge == 0)
+       if (_edge == 0)
                return 0;
-       if(_edge->B() == vertex)
+       if (_edge->B() == vertex)
                _orientation = true;
        else
                _orientation = false;
@@ -125,10 +125,10 @@ int ChainingIterator::decrement()
 int ChainSilhouetteIterator::traverse(const AdjacencyIterator& ait)
 {
        AdjacencyIterator it(ait);
-       ViewVertexnextVertex = getVertex();
+       ViewVertex *nextVertex = getVertex();
        // we can't get a NULL nextVertex here, it was intercepted before
        if (nextVertex->getNature() & Nature::T_VERTEX) {
-               TVertex * tvertex = (TVertex*)nextVertex;
+               TVertex *tvertex = (TVertex *)nextVertex;
                ViewEdge *mate = (tvertex)->mate(getCurrentEdge());
                while (!it.isEnd()) {
                        ViewEdge *ve = *it;
@@ -142,8 +142,8 @@ int ChainSilhouetteIterator::traverse(const AdjacencyIterator& ait)
                return 0;
        }
        if (nextVertex->getNature() & Nature::NON_T_VERTEX) {
-               //soc NonTVertex * nontvertex = (NonTVertex*)nextVertex;
-               ViewEdge * newEdge(0);
+               //soc NonTVertex *nontvertex = (NonTVertex*)nextVertex;
+               ViewEdge *newEdge(0);
                // we'll try to chain the edges by keeping the same nature...
                // the preseance order is : SILHOUETTE, BORDER, CREASE, SUGGESTIVE, VALLEY, RIDGE
                Nature::EdgeNature natures[6] = {
@@ -159,7 +159,7 @@ int ChainSilhouetteIterator::traverse(const AdjacencyIterator& ait)
                                int n = 0;
                                while (!it.isEnd()) {
                                        ViewEdge *ve = *it;
-                                       if(ve->getNature() & natures[i]) {
+                                       if (ve->getNature() & natures[i]) {
                                                ++n;
                                                newEdge = ve;
                                        }
index 66a57061ec986e20158b33f40d603641ed650b17..522513d09ef5e1e0a2ddd9461864909f3668d2fa 100644 (file)
@@ -112,9 +112,9 @@ public:
        bool isIncoming() const;
 
        /*! Returns a *pointer* to the pointed ViewEdge. */
-       virtual ViewEdgeoperator*();
+       virtual ViewEdge *operator*();
 
-       virtual ViewEdgeoperator->()
+       virtual ViewEdge *operator->()
        {
                return operator*();
        }
@@ -141,7 +141,7 @@ public:
        }
 
 protected:
-       bool isValid(ViewEdgeedge);
+       bool isValid(ViewEdge *edge);
 };
 
 //
@@ -178,14 +178,14 @@ public:
         *  \param orientation
         *    The direction to follow to explore the graph. If true, the direction indicated by the first ViewEdge is used.
         */
-       ChainingIterator(bool iRestrictToSelection = true, bool iRestrictToUnvisited = true, ViewEdge* begin = 0,
+       ChainingIterator(bool iRestrictToSelection = true, bool iRestrictToUnvisited = true, ViewEdge *begin = NULL,
                         bool orientation = true)
        : ViewEdgeIterator(begin, orientation)
        {
                _restrictToSelection = iRestrictToSelection;
                _restrictToUnvisited = iRestrictToUnvisited;
                _increment = true;
-               py_c_it = 0;
+               py_c_it = NULL;
        }
 
        /*! Copy constructor */
@@ -229,7 +229,7 @@ public:
        //inline bool getOrientation() const {}
 
        /*! Returns the vertex which is the next crossing */
-       inline ViewVertex * getVertex()
+       inline ViewVertex *getVertex()
        {
                if (_increment) {
                        if (_orientation) {
@@ -283,7 +283,7 @@ public:
         *    If true, we'll look for the next ViewEdge among the ViewEdges that surround the ending ViewVertex of begin.
         *    If false, we'll search over the ViewEdges surrounding the ending ViewVertex of begin.
         */
-       ChainSilhouetteIterator(bool iRestrictToSelection = true, ViewEdgebegin = NULL, bool orientation = true)
+       ChainSilhouetteIterator(bool iRestrictToSelection = true, ViewEdge *begin = NULL, bool orientation = true)
        : ChainingIterator(iRestrictToSelection, true, begin, orientation)
        {
        }
@@ -340,7 +340,7 @@ public:
         *    If true, we'll look for the next ViewEdge among the ViewEdges that surround the ending ViewVertex of begin.
         *    If false, we'll search over the ViewEdges surrounding the ending ViewVertex of begin.
         */
-       ChainPredicateIterator(bool iRestrictToSelection = true, bool iRestrictToUnvisited = true, ViewEdgebegin = NULL,
+       ChainPredicateIterator(bool iRestrictToSelection = true, bool iRestrictToUnvisited = true, ViewEdge *begin = NULL,
                               bool orientation = true)
        : ChainingIterator(iRestrictToSelection, iRestrictToUnvisited, begin, orientation)
        {
@@ -365,7 +365,7 @@ public:
         *    If false, we'll search over the ViewEdges surrounding the ending ViewVertex of begin.
         */
        ChainPredicateIterator(UnaryPredicate1D& upred, BinaryPredicate1D& bpred, bool iRestrictToSelection = true,
-                              bool iRestrictToUnvisited = true, ViewEdgebegin = NULL, bool orientation = true)
+                              bool iRestrictToUnvisited = true, ViewEdge *begin = NULL, bool orientation = true)
        : ChainingIterator(iRestrictToSelection, iRestrictToUnvisited, begin, orientation)
        {
                _unary_predicate = &upred;
index 7723c57921dc2c269ffa0558a9b451782aa1827e..5dfa212ee83b0a49745051009d4233613e3e45ef 100644 (file)
@@ -58,7 +58,7 @@ unsigned GetCanvasHeightCF()
 
 void LoadMapCF(const char *iFileName, const char *iMapName, unsigned iNbLevels, float iSigma)
 {
-       return Canvas::getInstance()->loadMap(iFileName, iMapName, iNbLevels,iSigma);
+       return Canvas::getInstance()->loadMap(iFileName, iMapName, iNbLevels, iSigma);
 }
 
 float ReadMapPixelCF(const char *iMapName, int level, unsigned x, unsigned y)
@@ -79,7 +79,7 @@ float ReadDirectionalViewMapPixelCF(int iOrientation, int level, unsigned x, uns
        return svm->readSteerableViewMapPixel(iOrientation, level, x, y);
 }
 
-FEdge * GetSelectedFEdgeCF()
+FEdge *GetSelectedFEdgeCF()
 {
        return Canvas::getInstance()->selectedFEdge();
 }
index 30d651421a4f557d208a8aef4a9395d80f84ff9e..0a95771d20107b414fe84468157f39d08fbedf5f 100644 (file)
@@ -204,7 +204,7 @@ FEdge *CurvePoint::fedge()
 
 FEdge *CurvePoint::getFEdge(Interface0D& inter)
 {
-       CurvePointiVertexB = dynamic_cast<CurvePoint*>(&inter);
+       CurvePoint *iVertexB = dynamic_cast<CurvePoint*>(&inter);
        if (!iVertexB) {
                cerr << "Warning: CurvePoint::getFEdge() failed to cast the given 0D element to CurvePoint." << endl;
                return 0;
@@ -261,7 +261,8 @@ FEdge *CurvePoint::getFEdge(Interface0D& inter)
                printf("iVertexB->B() 0x%p p (%f, %f)\n", iVertexB->B(), iVertexB->B()->getPoint2D().x(),
                                                          iVertexB->B()->getPoint2D().y());
                printf("_t2d            %f p (%f, %f)\n", _t2d, getPoint2D().x(), getPoint2D().y());
-               printf("iVertexB->t2d() %f p (%f, %f)\n", iVertexB->t2d(), iVertexB->getPoint2D().x(), iVertexB->getPoint2D().y());
+               printf("iVertexB->t2d() %f p (%f, %f)\n", iVertexB->t2d(), iVertexB->getPoint2D().x(),
+                      iVertexB->getPoint2D().y());
        }
 #endif
        cerr << "Warning: CurvePoint::getFEdge() failed." << endl;
index f451d83d65b032e05ebb21adef2f072e24666013..c8dbf36832322d2f148135c8107c8e432626c324 100644 (file)
@@ -124,7 +124,7 @@ public: // Implementation of Interface0D
                return Vec2f((float)_Point2d.x(), (float)_Point2d.y());
        }
 
-       virtual FEdgegetFEdge(Interface0D& inter);
+       virtual FEdge *getFEdge(Interface0D& inter);
 
        /*! Returns the CurvePoint's Id */
        virtual Id getId() const
@@ -149,7 +149,7 @@ public: // Implementation of Interface0D
        }
 
        /*! Cast the Interface0D in SVertex if it can be. */
-       virtual SVertex * castToSVertex()
+       virtual SVertex *castToSVertex()
        {
                if (_t2d == 0)
                        return __A;
@@ -159,7 +159,7 @@ public: // Implementation of Interface0D
        }
 
        /*! Cast the Interface0D in ViewVertex if it can be. */
-       virtual ViewVertex * castToViewVertex()
+       virtual ViewVertex *castToViewVertex()
        {
                if (_t2d == 0)
                        return __A->castToViewVertex();
@@ -169,7 +169,7 @@ public: // Implementation of Interface0D
        }
 
        /*! Cast the Interface0D in NonTVertex if it can be. */
-       virtual NonTVertex * castToNonTVertex()
+       virtual NonTVertex *castToNonTVertex()
        {
                if (_t2d == 0)
                        return __A->castToNonTVertex();
@@ -179,7 +179,7 @@ public: // Implementation of Interface0D
        }
 
        /*! Cast the Interface0D in TVertex if it can be. */
-       virtual TVertex * castToTVertex()
+       virtual TVertex *castToTVertex()
        {
                if (_t2d == 0)
                        return __A->castToTVertex();
index 0c053bf1845edad2ac98a21d9e2842226d53b10d..b87af51222048a239359eeaaeabd166a3ccfa967 100644 (file)
@@ -86,7 +86,7 @@ public:
        typedef CurvePoint<Vertex> Point;
        typedef Point point_type;
 #endif
-       typedef IteratorBase<Traits,BidirectionalIteratorTag_Traits> parent_class;
+       typedef IteratorBase<Traits, BidirectionalIteratorTag_Traits> parent_class;
 #if 0
 #if defined(__GNUC__) && (__GNUC__ < 3)
        typedef bidirectional_iterator<CurvePoint<Vertex>, ptrdiff_t> bidirectional_point_iterator;
@@ -294,7 +294,7 @@ protected:
                if (0 == _step) {  // means we iterate over initial vertices
                        Vec3r vec_tmp((*__B)->point2d() - (*__A)->point2d());
                        _CurvilinearLength += vec_tmp.norm();
-                       if (_currentn == _n-1) {
+                       if (_currentn == _n - 1) {
                                _t = 1.0f;
                                return;
                        }
index 7d9e0e00ef119d3483b0073cf2328bade2c6e649..e3c63aefd5bc61b8ddd4f43fcc6a4c0438d98461 100644 (file)
@@ -41,9 +41,9 @@
 namespace CurveInternal {
 
 /*! iterator on a curve. Allows an iterating outside 
-*  initial vertices. A CurvePoint is instanciated an returned 
-*  when the iterator is dereferenced.
-*/
+ *  initial vertices. A CurvePoint is instanciated an returned 
+ *  when the iterator is dereferenced.
+ */
 
 class CurvePointIterator : public Interface0DIteratorNested
 { 
@@ -128,7 +128,7 @@ protected:
        }
 
 public:
-       virtual CurvePointIteratorcopy() const
+       virtual CurvePointIterator *copy() const
        {
                return new CurvePointIterator(*this);
        }
@@ -160,7 +160,7 @@ public:
        // comparibility
        virtual bool operator==(const Interface0DIteratorNested& b) const
        {
-               const CurvePointIteratorit_exact = dynamic_cast<const CurvePointIterator*>(&b);
+               const CurvePointIterator *it_exact = dynamic_cast<const CurvePointIterator*>(&b);
                if (!it_exact)
                        return false;
                return ((__A == it_exact->__A) && (__B == it_exact->__B) && (_t == it_exact->_t));
@@ -172,7 +172,7 @@ public:
                return (_Point = CurvePoint(*__A, *__B, _t));
        }
 
-       virtual CurvePointoperator->()
+       virtual CurvePoint *operator->()
        {
                return &(operator*());
        }
index da6708e6ea98617c93f42ce3ad7c5915ce39b5ed..99cb5a08ded765d850799a3f29f142bf1d992b8c 100644 (file)
@@ -72,7 +72,7 @@ public:
        }
 
 private:
-       static StyleModulegetCurrentStyleModule()
+       static StyleModule *getCurrentStyleModule()
        {
                Canvas *canvas = Canvas::getInstance();
                return canvas->getCurrentStyleModule();
index e35a811fcab3f592b7a22b2cd2bc0b9fc388dcb2..df2c3dad175b22ee5db3aa3ecd0dcffa41005c58 100644 (file)
@@ -515,7 +515,7 @@ int Operators::sequentialSplit(UnaryPredicate0D& pred, float sampling)
                point = dynamic_cast<CurvePoint*>(&(*it));
                new_curve->push_vertex_back(point);
                ++it;
-               for (; it!= end; ++it) {
+               for (; it != end; ++it) {
                        point = dynamic_cast<CurvePoint*>(&(*it));
                        new_curve->push_vertex_back(point);
                        if (pred(it) < 0) {
@@ -623,14 +623,14 @@ int Operators::sequentialSplit(UnaryPredicate0D& startingPred, UnaryPredicate0D&
                                splitted_chains.push_back(new_curve);
                        }
                        // find next start
-                       do{
+                       do {
                                ++itStart;
                                if (itStart == end)
                                        break;
                                if (startingPred(itStart) < 0)
                                        goto error;
                        } while (!startingPred.result);
-               } while ((itStart!=end) && (itStart!=last));
+               } while ((itStart != end) && (itStart != last));
        }
 
        // Update the current set of chains:
index 0b527f9f2aff4194ee60384fd48e0210c7a9dd51..ddb58e2b54ae0c14dcac7179488d0ae0fdc8b93d 100644 (file)
@@ -46,8 +46,8 @@ PSStrokeRenderer::PSStrokeRenderer(const char *iFileName) : StrokeRenderer()
        }
        _ofstream << "%!PS-Adobe-2.0 EPSF-2.0" << endl;
        _ofstream << "%%Creator: Freestyle (http://artis.imag.fr/Software/Freestyle)" << endl;
-       _ofstream << "%%BoundingBox: " << 0 << " "<< 0 << " " << Canvas::getInstance()->width() << " "
-                 << Canvas::getInstance()->height() << endl;
+       _ofstream << "%%BoundingBox: " << 0 << " "<< 0 << " " << Canvas::getInstance()->width() << " " <<
+                    Canvas::getInstance()->height() << endl;
        _ofstream << "%%EndComments" << endl;
 }
 
index e01ec531471b7e82c8e4ee7f0b307bd9851d550f..fad15ece6d8cff7a053a13b7044030b1cff33aa4 100644 (file)
@@ -52,7 +52,7 @@
 class LIB_STROKE_EXPORT PSStrokeRenderer : public StrokeRenderer
 {
 public:
-       PSStrokeRenderer(const char * iFileName = 0);
+       PSStrokeRenderer(const char *iFileName = NULL);
        virtual ~PSStrokeRenderer();
 
        /*! Renders a stroke rep */
index 18e4328c4d5fc31479828f3694fbfd06f7fe3787..cf19bf2c03cc88d43eb7bbd53571d145e64acd27 100644 (file)
@@ -342,8 +342,7 @@ public:
        int operator()(Interface1D& inter)
        {
                ViewEdge *edge = dynamic_cast<ViewEdge*>(&inter);
-               if (!edge)
-               {
+               if (!edge) {
                        result = false;
                        return 0;
                }
index 7e6aa62ac59e3fdc75985a02fb88f0f430ed2b2c..b043afba0361f780731a91a312e01e5c20b18126 100644 (file)
@@ -371,7 +371,7 @@ StrokeVertex::~StrokeVertex() {}
 
 StrokeVertex& StrokeVertex::operator=(const StrokeVertex& iBrother)
 {
-       ((CurvePoint*)this)->operator=(iBrother);
+       ((CurvePoint *)this)->operator=(iBrother);
        _Attribute = iBrother._Attribute;
 
        _CurvilignAbscissa = 0.0f;
@@ -883,7 +883,7 @@ inline const polygon3d& occludee() const
 }
 #endif
 
-const SShape * Stroke::occluded_shape() const
+const SShape *Stroke::occluded_shape() const
 {
        const_vertex_iterator v = vertices_begin(), vend = vertices_end();
        const SShape *sshape = (*v)->occluded_shape();
@@ -905,7 +905,7 @@ const bool Stroke::occludee_empty() const
        return empty;
 }
 
-const SShape * Stroke::shape() const
+const SShape *Stroke::shape() const
 {
        const_vertex_iterator v = vertices_begin(), vend = vertices_end();
        const SShape *sshape = (*v)->shape();
index 51733a058a92d86e43902b77f10b691e4782d2de..a2ff7e4dc074d6a788295b9598ce81670054fb15 100644 (file)
@@ -292,9 +292,9 @@ public:
        void setAttributeVec3f(const char *iName, const Vec3f& att);
 
 private:
-       typedef std::map<const char*, float, StringUtils::ltstr> realMap;
-       typedef std::map<const char*, Vec2f, StringUtils::ltstr> Vec2fMap;
-       typedef std::map<const char*, Vec3f, StringUtils::ltstr> Vec3fMap;
+       typedef std::map<const char *, float, StringUtils::ltstr> realMap;
+       typedef std::map<const char *, Vec2f, StringUtils::ltstr> Vec2fMap;
+       typedef std::map<const char *, Vec3f, StringUtils::ltstr> Vec3fMap;
 
        float _color[3];      //! the color
        float _alpha;         //! alpha
index adaa5548bf9fcab89a26311543bf589fd2074d69..3d0f13276fb98475373ddaf8205e5942f4b61b4b 100644 (file)
@@ -56,13 +56,13 @@ public:
 
 
 template<class Traits>
-class vertex_iterator_base : public IteratorBase<Traits,BidirectionalIteratorTag_Traits>
+class vertex_iterator_base : public IteratorBase<Traits, BidirectionalIteratorTag_Traits>
 {
 public:
        typedef vertex_iterator_base<Traits>  Self;
 
 protected:
-       typedef IteratorBase<Traits,BidirectionalIteratorTag_Traits> parent_class;
+       typedef IteratorBase<Traits, BidirectionalIteratorTag_Traits> parent_class;
        typedef typename Traits::vertex_container_iterator vertex_container_iterator;
        typedef vertex_iterator_base<vertex_nonconst_traits> iterator;
        typedef vertex_iterator_base<vertex_const_traits> const_iterator;
index a101ec676189999ca0a49804547d091003699269..182ae258480d5fc4c79921625016a072fb9eb1a8 100644 (file)
 ostream& operator<<(ostream& out, const StrokeAttribute& iStrokeAttribute)
 {
        out << "    StrokeAttribute" << endl;
-       out << "      color     : (" << iStrokeAttribute.getColorR() << "," << iStrokeAttribute.getColorG()
-           << "," << iStrokeAttribute.getColorB() << ")" << endl;
+       out << "      color     : (" << iStrokeAttribute.getColorR() << "," << iStrokeAttribute.getColorG() <<
+              "," << iStrokeAttribute.getColorB() << ")" << endl;
        out << "      alpha     : " << iStrokeAttribute.getAlpha() << endl;
-       out << "      thickness : " << iStrokeAttribute.getThicknessR() << ", " << iStrokeAttribute.getThicknessL() << endl;
+       out << "      thickness : " << iStrokeAttribute.getThicknessR() << ", " << iStrokeAttribute.getThicknessL() <<
+              endl;
        out << "      visible   : " << iStrokeAttribute.isVisible() << endl;
        return out;
 }
@@ -52,10 +53,10 @@ ostream& operator<<(ostream& out, const StrokeVertex& iStrokeVertex)
        out << "  StrokeVertex" << endl;
        out << "    id                 : " << iStrokeVertex.getId() << endl;
        out << "    curvilinear length : " << iStrokeVertex.curvilinearAbscissa() << endl;
-       out << "    2d coordinates     : (" << iStrokeVertex.getProjectedX() << "," << iStrokeVertex.getProjectedY()
-           << "," << iStrokeVertex.getProjectedZ() << ")" << endl;
-       out << "    3d coordinates     : (" << iStrokeVertex.getX() << "," << iStrokeVertex.getY()
-           << "," << iStrokeVertex.getZ() << ")" << endl;
+       out << "    2d coordinates     : (" << iStrokeVertex.getProjectedX() << "," << iStrokeVertex.getProjectedY() <<
+              "," << iStrokeVertex.getProjectedZ() << ")" << endl;
+       out << "    3d coordinates     : (" << iStrokeVertex.getX() << "," << iStrokeVertex.getY() <<
+              "," << iStrokeVertex.getZ() << ")" << endl;
        out << iStrokeVertex.attribute() << endl;
        return out;
 }
@@ -66,7 +67,10 @@ ostream& operator<<(ostream& out, const Stroke& iStroke)
        out << "  id          : " << iStroke.getId() << endl;
        out << "  length      : " << iStroke.getLength2D() << endl;
        out << "  medium type : " << iStroke.getMediumType() << endl;
-       for(Stroke::const_vertex_iterator v = iStroke.vertices_begin(), vend = iStroke.vertices_end(); v != vend; ++v) {
+       for (Stroke::const_vertex_iterator v = iStroke.vertices_begin(), vend = iStroke.vertices_end();
+            v != vend;
+            ++v)
+       {
                out << *(*v) << endl;
        }
        return out;
index 37f6a8843bdce7ca69b6868442e47691248200e6..9cb8f5176843f43322c4c7688a59fcee948d5c72 100644 (file)
@@ -121,7 +121,7 @@ public:
        /*! Returns a pointer to the pointed StrokeVertex.
         * Can't be called in the scripting language.
         */
-       virtual StrokeVertexoperator->()
+       virtual StrokeVertex *operator->()
        {
                return &(operator*());
        }
@@ -185,7 +185,7 @@ public:
        /*! operator == */
        virtual bool operator==(const Interface0DIteratorNested& it) const
        {
-               const StrokeVertexIterator* it_exact = dynamic_cast<const StrokeVertexIterator*>(&it);
+               const StrokeVertexIterator *it_exact = dynamic_cast<const StrokeVertexIterator *>(&it);
                if (!it_exact)
                        return false;
                return (_it == it_exact->_it);
@@ -204,7 +204,7 @@ public:
        }
 
        /*! Cloning method */
-       virtual StrokeVertexIteratorcopy() const
+       virtual StrokeVertexIterator *copy() const
        {
                return new StrokeVertexIterator(*this);
        }
index 56c5f2b5001824904deb1770f5e3876dca1e0f84..604cf6bd93d6ed25c415992366b450f8b29217fe 100644 (file)
@@ -70,7 +70,7 @@ bool StrokeRenderer::loadTextures()
 
 
 LIB_STROKE_EXPORT
-TextureManagerTextureManager::_pInstance = 0;
+TextureManager *TextureManager::_pInstance = 0;
 
 LIB_STROKE_EXPORT
 string TextureManager::_patterns_path;
@@ -102,7 +102,7 @@ void TextureManager::load()
 
 unsigned TextureManager::getBrushTextureIndex(string name, Stroke::MediumType loadingMode)
 {
-       BrushTexture bt(name,loadingMode);
+       BrushTexture bt(name, loadingMode);
        brushesMap::iterator b = _brushesMap.find(bt);
        if (b == _brushesMap.end()) {
                unsigned texId = loadBrush(name, loadingMode);
index ab451a14496bd753d5504a217ba620a342c1f997..db169fb3fa254810d3ca62b91b47de459bb6c764 100644 (file)
@@ -92,7 +92,7 @@ protected:
        virtual void loadStandardBrushes() = 0;
        virtual unsigned loadBrush(string fileName, Stroke::MediumType = Stroke::OPAQUE_MEDIUM) = 0;
 
-       typedef std::pair<string,Stroke::MediumType> BrushTexture;
+       typedef std::pair<string, Stroke::MediumType> BrushTexture;
        struct cmpBrushTexture
        {
                bool operator()(const BrushTexture& bt1, const BrushTexture& bt2) const
index bc117925a4cd5cd3b338e401aca30e43a3922ed1..10c3c2efe18b70978e5b5e66ed0d0e14745bb01e 100644 (file)
@@ -124,7 +124,7 @@ void Strip::createStrip (const vector<StrokeVertex*>& iStrokeVertices)
        }
        _averageThickness = 0.0;
 
-       vector<StrokeVertex*>::const_iterator v ,vend, v2, vPrev;
+       vector<StrokeVertex *>::const_iterator v, vend, v2, vPrev;
        StrokeVertex *sv, *sv2, *svPrev;
 
        //special case of first vertex
@@ -350,7 +350,7 @@ void Strip::cleanUpSingularities (const vector<StrokeVertex*>& iStrokeVertices)
        if (iStrokeVertices.size() < 2)
                return;
        int i = 0, j;
-       vector<StrokeVertex*>::const_iterator v ,vend, v2, vPrev;
+       vector<StrokeVertex *>::const_iterator v, vend, v2, vPrev;
        StrokeVertex *sv, *sv2; //soc unused -  *svPrev;
 
        bool singu1 = false, singu2 = false;
@@ -367,7 +367,7 @@ void Strip::cleanUpSingularities (const vector<StrokeVertex*>& iStrokeVertices)
                sv2 = (*v2);
                Vec2r p(sv->getPoint()), p2(sv2->getPoint());
 
-               Vec2r dir(p2-p);
+               Vec2r dir(p2 - p);
                if (dir.norm() > ZERO)
                        dir.normalize();
                Vec2r dir1, dir2;
@@ -386,7 +386,7 @@ void Strip::cleanUpSingularities (const vector<StrokeVertex*>& iStrokeVertices)
                                //traverse all the vertices of the singularity and average them
                                Vec2r avP(0.0, 0.0);
                                for (j = i - timeSinceSingu1; j < i + 1; j++)
-                                       avP=Vec2r(avP + _vertices[2 * j]->point2d());
+                                       avP = Vec2r(avP + _vertices[2 * j]->point2d());
                                avP = Vec2r( 1.0 / float(timeSinceSingu1 + 1) * avP);
                                for (j = i - timeSinceSingu1; j < i + 1; j++)
                                        _vertices[2 * j]->setPoint2d(avP);
@@ -438,7 +438,7 @@ void Strip::cleanUpSingularities (const vector<StrokeVertex*>& iStrokeVertices)
                        _vertices[2 * j + 1]->setPoint2d(avP);
        }
 
-       for (k=0; k<sizeStrip; k++) {
+       for (k = 0; k < sizeStrip; k++) {
                if (notValid(_vertices[k]->point2d())) {
                        cerr << "Warning: strip vertex " << k << " non valid after cleanup" << endl;
                        return;
@@ -450,9 +450,9 @@ void Strip::cleanUpSingularities (const vector<StrokeVertex*>& iStrokeVertices)
 // Texture coordinates
 ////////////////////////////////
 
-void Strip::computeTexCoord (const vector<StrokeVertex*>& iStrokeVertices)
+void Strip::computeTexCoord (const vector<StrokeVertex *>& iStrokeVertices)
 {
-       vector<StrokeVertex*>::const_iterator v ,vend;
+       vector<StrokeVertex *>::const_iterator v, vend;
        StrokeVertex *sv;
        int i = 0;
        for (v = iStrokeVertices.begin(), vend = iStrokeVertices.end(); v != vend; v++) {
index c8d84cb237a8f37003907a4875712bc03c81bb15..419659d1427d6b9088a45abb9e9692fecc85e669 100644 (file)
@@ -63,7 +63,7 @@ using namespace Geometry;
 class StrokeVertexRep
 {
 public:
-       StrokeVertexRep(){}
+       StrokeVertexRep() {}
 
        StrokeVertexRep(const Vec2r& iPoint2d)
        {
@@ -72,7 +72,7 @@ public:
 
        StrokeVertexRep(const StrokeVertexRep& iBrother);
 
-       virtual ~StrokeVertexRep(){}
+       virtual ~StrokeVertexRep() {}
 
        inline Vec2r& point2d()
        {
@@ -197,7 +197,7 @@ public:
                return _strips.size();
        }
 
-       inline Stroke * getStroke()
+       inline Stroke *getStroke()
        {
                return _stroke;
        }
index 43cf1818fb0cc5e78e917f56226282e8f70a0122..b6805e4220df98f3d9e7de153f178a7e246ed61e 100644 (file)
@@ -44,10 +44,10 @@ LineRep *StrokeTesselator::Tesselate(Stroke *iStroke)
        if (0 == iStroke)
                return 0;
 
-       LineRepline;
+       LineRep *line;
        line = new OrientedLineRep();
 
-       Stroke::vertex_iterator v,vend;
+       Stroke::vertex_iterator v, vend;
        if (2 == iStroke->vertices_size()) {
                line->setStyle(LineRep::LINES);
                v = iStroke->vertices_begin();
index ea5af287bbee905454c987619ce7055c68d5b1d5..37583660dd20df6bcffc6494c996e4009e0cbc05 100644 (file)
 # include "Canvas.h"
 # include "StrokeIterators.h"
 
-TextStrokeRenderer::TextStrokeRenderer(const char* iFileName)
-:StrokeRenderer(){
-  if(!iFileName)
-    iFileName = "freestyle.txt";
-  // open the stream:
-  _ofstream.open(iFileName, ios::out);
-  if(!_ofstream.is_open()){
-    cerr << "couldn't open the output file " << iFileName << endl;
-  }
-  _ofstream << "%!FREESTYLE" << endl;
-  _ofstream << "%Creator: Freestyle (http://artis.imag.fr/Software/Freestyle)" << endl;
-  // Bounding box
-  _ofstream << 0 << " "<< 0 << " " << Canvas::getInstance()->width() << " " << Canvas::getInstance()->height() << endl;
-  _ofstream << "%u x y z tleft tright r g b ..." << endl;
+TextStrokeRenderer::TextStrokeRenderer(const char *iFileName)
+:StrokeRenderer()
+{
+       if (!iFileName)
+               iFileName = "freestyle.txt";
+       // open the stream:
+       _ofstream.open(iFileName, ios::out);
+       if (!_ofstream.is_open()) {
+               cerr << "couldn't open the output file " << iFileName << endl;
+       }
+       _ofstream << "%!FREESTYLE" << endl;
+       _ofstream << "%Creator: Freestyle (http://artis.imag.fr/Software/Freestyle)" << endl;
+       // Bounding box
+       _ofstream << 0 << " "<< 0 << " " << Canvas::getInstance()->width() << " " << Canvas::getInstance()->height() <<
+                    endl;
+       _ofstream << "%u x y z tleft tright r g b ..." << endl;
 }
 
-TextStrokeRenderer::~TextStrokeRenderer(){
-  Close();
+TextStrokeRenderer::~TextStrokeRenderer()
+{
+       Close();
 }
 
-void TextStrokeRenderer::RenderStrokeRep(StrokeRep *iStrokeRep) const{
-  RenderStrokeRepBasic(iStrokeRep);
+void TextStrokeRenderer::RenderStrokeRep(StrokeRep *iStrokeRep) const
+{
+       RenderStrokeRepBasic(iStrokeRep);
 }
 
-void TextStrokeRenderer::RenderStrokeRepBasic(StrokeRep *iStrokeRep) const{
-  Stroke *stroke = iStrokeRep->getStroke();
-  if(!stroke){
-    cerr << "no stroke associated with Rep" << endl;
-    return;
-  }
-    
-  StrokeInternal::StrokeVertexIterator v = stroke->strokeVerticesBegin();
-  StrokeAttribute att;
-  while(!v.isEnd()){
-    att = v->attribute();
-    _ofstream << v->u() << " " << v->getProjectedX() << " " << v->getProjectedY() << " " << v->getProjectedZ() << " " \
-      << att.getThicknessL() << " " << att.getThicknessR() << " " \
-      << att.getColorR() << " " << att.getColorG() << " " << att.getColorB() << " ";
-    ++v;
-  }
-  _ofstream << endl;
+void TextStrokeRenderer::RenderStrokeRepBasic(StrokeRep *iStrokeRep) const
+{
+       Stroke *stroke = iStrokeRep->getStroke();
+       if (!stroke) {
+               cerr << "no stroke associated with Rep" << endl;
+               return;
+       }
+
+       StrokeInternal::StrokeVertexIterator v = stroke->strokeVerticesBegin();
+       StrokeAttribute att;
+       while (!v.isEnd()) {
+               att = v->attribute();
+               _ofstream << v->u() << " " << v->getProjectedX() << " " << v->getProjectedY() << " " << v->getProjectedZ() <<
+                            " " << att.getThicknessL() << " " << att.getThicknessR() << " " <<
+                            att.getColorR() << " " << att.getColorG() << " " << att.getColorB() << " ";
+               ++v;
+       }
+       _ofstream << endl;
 }
 
-void TextStrokeRenderer::Close(){
-  if(_ofstream.is_open())
-    _ofstream.close();
+void TextStrokeRenderer::Close()
+{
+       if (_ofstream.is_open())
+               _ofstream.close();
 }
 
index cc6f5c05073341f12030dea8faaac48a07c16d22..144724f26f8ee266c8792e8f8a4f38266c7fffd1 100644 (file)
@@ -50,7 +50,7 @@
 class LIB_STROKE_EXPORT TextStrokeRenderer : public StrokeRenderer
 {
 public:
-  TextStrokeRenderer(const char * iFileName = 0);
+  TextStrokeRenderer(const char *iFileName = NULL);
   virtual ~TextStrokeRenderer();
 
   /*! Renders a stroke rep */
index 9d81af1be3b336160be778c4ffad98707f630292..7c79caa5259f5f8d721759d3e7cd31935f09814b 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef __FREESTYLE_CONFIG_H__
 #define __FREESTYLE_CONFIG_H__
 
-/** \file blender/freestyle/intern/system/Config.h
+/** \file blender/freestyle/intern/system/FreestyleConfig.h
  *  \ingroup freestyle
  *  \brief Configuration definitions
  *  \author Emmanuel Turquin
index bd50e0c539202b66bd469944ffb9964103cd2e9a..6052c0abe01627af0cc6f19d3009e9fdb22c3903 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef __FREESTYLE_RENDER_MONITOR_H__
 #define __FREESTYLE_RENDER_MONITOR_H__
 
-/** \file blender/freestyle/intern/system/BaseIterator.h
+/** \file blender/freestyle/intern/system/RenderMonitor.h
  *  \ingroup freestyle
  *  \brief Classes defining the basic "Iterator" design pattern
  *  \author Stephane Grabli
index c83ab44a25993a92937952be1da77123059538a9..2be2fe2cb5a9efaf9db6e01be400e3bbd361c6fc 100644 (file)
@@ -83,9 +83,9 @@ BoxGrid::Iterator::Iterator (BoxGrid& grid, Vec3r& center, real epsilon)
        _cell = grid.findCell(_target);
        #if BOX_GRID_LOGGING
                if (G.debug & G_DEBUG_FREESTYLE) {
-                       cout << "Searching for occluders of edge centered at " << _target << " in cell ["
-                            << _cell->boundary[0] << ", " << _cell->boundary[1] << ", " << _cell->boundary[2]
-                            << ", " << _cell->boundary[3] << "] (" << _cell->faces.size() << " occluders)" << endl;
+                       cout << "Searching for occluders of edge centered at " << _target << " in cell [" <<
+                               1_cell->boundary[0] << ", " << _cell->boundary[1] << ", " << _cell->boundary[2] <<
+                               ", " << _cell->boundary[3] << "] (" << _cell->faces.size() << " occluders)" << endl;
                }
        #endif
 
@@ -159,7 +159,7 @@ void BoxGrid::assignCells (OccluderSource& source, GridDensityProvider& density,
                                height = _cellSize;
 
                                // Initialize cell
-                               Cellb = _cells[i * _cellsY + j] = new Cell();
+                               Cell *b = _cells[i * _cellsY + j] = new Cell();
                                b->setDimensions(x, y, width, height);
                        }
                }
@@ -211,7 +211,7 @@ void BoxGrid::getCellCoordinates(const Vec3r& point, unsigned& x, unsigned& y)
        y = min(_cellsY - 1, (unsigned) floor (max((double) 0.0f, point[1] - _cellOrigin[1]) / _cellSize));
 }
 
-BoxGrid::CellBoxGrid::findCell(const Vec3r& point)
+BoxGrid::Cell *BoxGrid::findCell(const Vec3r& point)
 {
        unsigned int x, y;
        getCellCoordinates(point, x, y);
index 50ca1622e99a0bf306760fe1297f8f51e054e493..22f3b6fa698872df3b5d1056c41e4fb4b2bbaba0 100644 (file)
@@ -70,7 +70,7 @@ public:
                // N.B. We could, of course, store face in poly's userdata member, like the old ViewMapBuilder code does.
                // However, code comments make it clear that userdata is deprecated, so we avoid the temptation
                // to save 4 or 8 bytes.
-               WFaceface;
+               WFace *face;
        };
 
 private:
@@ -194,21 +194,21 @@ inline void BoxGrid::Iterator::initBeforeTarget()
 inline void BoxGrid::Iterator::initAfterTarget()
 {
        if (_foundOccludee) {
-               #if BOX_GRID_LOGGING
-                       if (G.debug & G_DEBUG_FREESTYLE) {
-                               std::cout << "\tStarting occludee search from occludeeCandidate at depth "
-                                         << _occludeeDepth << std::endl;
-                       }
-               #endif
+#if BOX_GRID_LOGGING
+               if (G.debug & G_DEBUG_FREESTYLE) {
+                       std::cout << "\tStarting occludee search from occludeeCandidate at depth " <<
+                                    _occludeeDepth << std::endl;
+               }
+#endif
                _current = _occludeeCandidate;
                return;
        }
 
-       #if BOX_GRID_LOGGING
-               if (G.debug & G_DEBUG_FREESTYLE) {
-                       std::cout << "\tStarting occludee search from current position" << std::endl;
-               }
-       #endif
+#if BOX_GRID_LOGGING
+       if (G.debug & G_DEBUG_FREESTYLE) {
+               std::cout << "\tStarting occludee search from current position" << std::endl;
+       }
+#endif
 
        while (_current != _cell->faces.end() && !testOccluder(true)) {
                ++_current;
@@ -223,23 +223,23 @@ inline bool BoxGrid::Iterator::testOccluder(bool wantOccludee)
                // and _current = _cell->face.end() will make the calling routine give up.
                return true;
        }
-       #if BOX_GRID_LOGGING
-               if (G.debug & G_DEBUG_FREESTYLE) {
-                       std::cout << "\tTesting occluder " << (*_current)->poly.getVertices()[0];
-                       for (unsigned int i = 1; i < (*_current)->poly.getVertices().size(); ++i) {
-                               std::cout << ", " << (*_current)->poly.getVertices()[i];
-                       }
-                       std::cout << " from shape " << (*_current)->face->GetVertex(0)->shape()->GetId() << std::endl;
+#if BOX_GRID_LOGGING
+       if (G.debug & G_DEBUG_FREESTYLE) {
+               std::cout << "\tTesting occluder " << (*_current)->poly.getVertices()[0];
+               for (unsigned int i = 1; i < (*_current)->poly.getVertices().size(); ++i) {
+                       std::cout << ", " << (*_current)->poly.getVertices()[i];
                }
-       #endif
+               std::cout << " from shape " << (*_current)->face->GetVertex(0)->shape()->GetId() << std::endl;
+       }
+#endif
 
        // If we have an occluder candidate and we are unambiguously after it, abort
        if (_foundOccludee && (*_current)->shallowest > _occludeeDepth) {
-               #if BOX_GRID_LOGGING
-                       if (G.debug & G_DEBUG_FREESTYLE) {
-                               std::cout << "\t\tAborting: shallowest > occludeeCandidate->deepest" << std::endl;
-                       }
-               #endif
+#if BOX_GRID_LOGGING
+               if (G.debug & G_DEBUG_FREESTYLE) {
+                       std::cout << "\t\tAborting: shallowest > occludeeCandidate->deepest" << std::endl;
+               }
+#endif
                _current = _cell->faces.end();
 
                // See note above
@@ -249,21 +249,21 @@ inline bool BoxGrid::Iterator::testOccluder(bool wantOccludee)
        // Specific continue or stop conditions when searching for each type
        if (wantOccludee) {
                if ((*_current)->deepest < _target[2]) {
-                       #if BOX_GRID_LOGGING
-                               if (G.debug & G_DEBUG_FREESTYLE) {
-                                       std::cout << "\t\tSkipping: shallower than target while looking for occludee" << std::endl;
-                               }
-                       #endif
+#if BOX_GRID_LOGGING
+                       if (G.debug & G_DEBUG_FREESTYLE) {
+                               std::cout << "\t\tSkipping: shallower than target while looking for occludee" << std::endl;
+                       }
+#endif
                        return false;
                }
        }
        else {
                if ((*_current)->shallowest > _target[2]) {
-                       #if BOX_GRID_LOGGING
-                               if (G.debug & G_DEBUG_FREESTYLE) {
-                                       std::cout << "\t\tStopping: deeper than target while looking for occluder" << std::endl;
-                               }
-                       #endif
+#if BOX_GRID_LOGGING
+                       if (G.debug & G_DEBUG_FREESTYLE) {
+                               std::cout << "\t\tStopping: deeper than target while looking for occluder" << std::endl;
+                       }
+#endif
                        return true;
                }
        }
@@ -274,11 +274,11 @@ inline bool BoxGrid::Iterator::testOccluder(bool wantOccludee)
        Vec3r bbMin, bbMax;
        (*_current)->poly.getBBox(bbMin, bbMax);
        if (_target[0] < bbMin[0] || _target[0] > bbMax[0] || _target[1] < bbMin[1] || _target[1] > bbMax[1]) {
-               #if BOX_GRID_LOGGING
-                       if (G.debug & G_DEBUG_FREESTYLE) {
-                               std::cout << "\t\tSkipping: bounding box violation" << std::endl;
-                       }
-               #endif
+#if BOX_GRID_LOGGING
+               if (G.debug & G_DEBUG_FREESTYLE) {
+                       std::cout << "\t\tSkipping: bounding box violation" << std::endl;
+               }
+#endif
                return false;
        }
 
@@ -298,22 +298,22 @@ inline void BoxGrid::Iterator::reportDepth(Vec3r origin, Vec3r u, real t)
                }
        #endif
        if (depth > _target[2]) {
-               #if BOX_GRID_LOGGING
-                       if (G.debug & G_DEBUG_FREESTYLE) {
-                               std::cout << " is deeper than target" << std::endl;
-                       }
-               #endif
+#if BOX_GRID_LOGGING
+               if (G.debug & G_DEBUG_FREESTYLE) {
+                       std::cout << " is deeper than target" << std::endl;
+               }
+#endif
                // If the current occluder is the best occludee so far, save it.
                if (! _foundOccludee || _occludeeDepth > depth) {
                        markCurrentOccludeeCandidate(depth);
                }
        }
        else {
-               #if BOX_GRID_LOGGING
-                       if (G.debug & G_DEBUG_FREESTYLE) {
-                               std::cout << std::endl;
-                       }
-               #endif
+#if BOX_GRID_LOGGING
+               if (G.debug & G_DEBUG_FREESTYLE) {
+                       std::cout << std::endl;
+               }
+#endif
        }
 }
 
@@ -347,22 +347,22 @@ inline bool BoxGrid::Iterator::validAfterTarget()
 
 inline void BoxGrid::Iterator::markCurrentOccludeeCandidate(real depth)
 {
-       #if BOX_GRID_LOGGING
-               if (G.debug & G_DEBUG_FREESTYLE) {
-                       std::cout << "\t\tFound occludeeCandidate at depth " << depth << std::endl;
-               }
-       #endif
+#if BOX_GRID_LOGGING
+       if (G.debug & G_DEBUG_FREESTYLE) {
+               std::cout << "\t\tFound occludeeCandidate at depth " << depth << std::endl;
+       }
+#endif
        _occludeeCandidate = _current;
        _occludeeDepth = depth;
        _foundOccludee = true;
 }
 
-inline WFaceBoxGrid::Iterator::getWFace() const
+inline WFace *BoxGrid::Iterator::getWFace() const
 {
        return (*_current)->face;
 }
 
-inline Polygon3rBoxGrid::Iterator::getCameraSpacePolygon()
+inline Polygon3r *BoxGrid::Iterator::getCameraSpacePolygon()
 {
        return &((*_current)->cameraSpacePolygon);
 }
index 2c9a9def4fc9b43afeeed5234c2d211c8da86bf8..53bd76b81f2fc531ba5b81f2fc2fbfea8da913ca 100644 (file)
@@ -127,8 +127,8 @@ void CulledOccluderSource::cullViewEdges(ViewMap& viewMap, bool extensiveFEdgeSe
        prosceniumOrigin[1] = (viewProscenium[3] - viewProscenium[2]) / 2.0;
        if (G.debug & G_DEBUG_FREESTYLE) {
                cout << "Proscenium culling:" << endl;
-               cout << "Proscenium: [" << viewProscenium[0] << ", " << viewProscenium[1] << ", " << viewProscenium[2]
-                    << ", " << viewProscenium[3] << "]"<< endl;
+               cout << "Proscenium: [" << viewProscenium[0] << ", " << viewProscenium[1] << ", " << viewProscenium[2] <<
+                       ", " << viewProscenium[3] << "]"<< endl;
                cout << "Origin: [" << prosceniumOrigin[0] << ", " << prosceniumOrigin[1] << "]"<< endl;
        }
 
index 2ded242e9ea217cabfdad51aa45269ac20858557..e95bbe446279b4137c7a891094a38543c96083bc 100644 (file)
@@ -129,7 +129,7 @@ void FEdgeXDetector::preProcessShape(WXShape *iWShape)
        vector<WFace*>::iterator f, fend;
        // view dependant stuff
        for (f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
-               preProcessFace((WXFace*)(*f));
+               preProcessFace((WXFace *)(*f));
        }
 
        if (_computeRidgesAndValleys || _computeSuggestiveContours) {
@@ -257,14 +257,14 @@ void FEdgeXDetector::processSilhouetteShape(WXShape *iWShape)
        vector<WFace*>& wfaces = iWShape->GetFaceList();
        vector<WFace*>::iterator f, fend;
        for (f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
-               ProcessSilhouetteFace((WXFace*)(*f));
+               ProcessSilhouetteFace((WXFace *)(*f));
        }
 
        // Make a pass on the edges to detect the silhouette edges that are not smooth
        vector<WEdge*>::iterator we, weend;
        vector<WEdge*> &wedges = iWShape->getEdgeList();
        for (we = wedges.begin(), weend = wedges.end(); we != weend; ++we) {
-               ProcessSilhouetteEdge((WXEdge*)(*we));
+               ProcessSilhouetteEdge((WXEdge *)(*we));
        }
 }
 
@@ -321,8 +321,8 @@ void FEdgeXDetector::ProcessSilhouetteEdge(WXEdge *iEdge)
        WXFace *fB = (WXFace *)iEdge->GetaOEdge()->GetbFace();
 
        if ((fA->front()) ^ (fB->front())) { // fA->visible XOR fB->visible (true if one is 0 and the other is 1)
-               // The only edges we want to set as silhouette edges in this way are the ones with 2 different normals for 1 vertex
-               // for these two faces
+               // The only edges we want to set as silhouette edges in this way are the ones with 2 different normals
+               // for 1 vertex for these two faces
                //--------------------
                // In reality we only test the normals for 1 of the 2 vertices.
                if (fA->GetVertexNormal(iEdge->GetaVertex()) == fB->GetVertexNormal(iEdge->GetaVertex()))
@@ -403,7 +403,7 @@ void FEdgeXDetector::processRidgesAndValleysShape(WXShape *iWShape)
        vector<WFace*>& wfaces = iWShape->GetFaceList();
        vector<WFace*>::iterator f, fend;
        for (f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
-               ProcessRidgeFace((WXFace*)(*f));
+               ProcessRidgeFace((WXFace *)(*f));
        }
 }
 
@@ -412,7 +412,7 @@ void FEdgeXDetector::processRidgesAndValleysShape(WXShape *iWShape)
 /////////
 void FEdgeXDetector::ProcessRidgeFace(WXFace *iFace)
 {
-       WXFaceLayer *flayer = new WXFaceLayer(iFace, Nature::RIDGE|Nature::VALLEY, false);
+       WXFaceLayer *flayer = new WXFaceLayer(iFace, Nature::RIDGE | Nature::VALLEY, false);
        iFace->AddSmoothLayer(flayer);
 
        unsigned int numVertices = iFace->numberOfVertices();
@@ -549,7 +549,7 @@ void FEdgeXDetector::processSuggestiveContourShape(WXShape *iWShape)
        vector<WFace*>& wfaces = iWShape->GetFaceList();
        vector<WFace*>::iterator f, fend;
        for (f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
-               ProcessSuggestiveContourFace((WXFace*)(*f));
+               ProcessSuggestiveContourFace((WXFace *)(*f));
        }
 }
 
@@ -583,13 +583,14 @@ void FEdgeXDetector::postProcessSuggestiveContourShape(WXShape *iShape)
        vector<WFace*>& wfaces = iShape->GetFaceList();
        vector<WFace*>::iterator f, fend;
        for (f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
-               postProcessSuggestiveContourFace((WXFace*)(*f));
+               postProcessSuggestiveContourFace((WXFace *)(*f));
        }
 }
 
 void FEdgeXDetector::postProcessSuggestiveContourFace(WXFace *iFace)
 {
-       // Compute the derivative of the radial curvature in the radial direction, at the two extremities of the smooth edge.
+       // Compute the derivative of the radial curvature in the radial direction, at the two extremities
+       // of the smooth edge.
        // If the derivative is smaller than a given threshold _kr_derivative_epsilon, discard the edge.
 
        // Find the suggestive contour layer of the face (zero or one edge).
@@ -613,7 +614,7 @@ void FEdgeXDetector::postProcessSuggestiveContourFace(WXFace *iFace)
        real kr(0), kr1(0), kr2(0), t;
 
        for (unsigned int i = 0; i < vertices_nb; ++i) {
-               v = (WXVertex*)(iFace->GetVertex(i));
+               v = (WXVertex *)(iFace->GetVertex(i));
 
                // v is a singular vertex, skip it.
                if (v->isBoundary()) {
@@ -695,7 +696,7 @@ void FEdgeXDetector::processMaterialBoundaryShape(WXShape *iWShape)
        vector<WEdge*>::iterator we, weend;
        vector<WEdge*> &wedges = iWShape->getEdgeList();
        for (we = wedges.begin(), weend = wedges.end(); we != weend; ++we) {
-               ProcessMaterialBoundaryEdge((WXEdge*)(*we));
+               ProcessMaterialBoundaryEdge((WXEdge *)(*we));
        }
 }
 
@@ -717,7 +718,7 @@ void FEdgeXDetector::processEdgeMarksShape(WXShape *iShape)
        vector<WEdge*>::iterator we, weend;
        vector<WEdge*> &wedges = iShape->getEdgeList();
        for (we = wedges.begin(), weend = wedges.end(); we != weend; ++we) {
-               ProcessEdgeMarks((WXEdge*)(*we));
+               ProcessEdgeMarks((WXEdge *)(*we));
        }
 }
 
@@ -737,9 +738,9 @@ void FEdgeXDetector::buildSmoothEdges(WXShape *iShape)
        // Make a last pass to build smooth edges from the previous stored values:
        //--------------------------------------------------------------------------
        vector<WFace*>& wfaces = iShape->GetFaceList();
-       for (vector<WFace*>::iterator f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
-               vector<WXFaceLayer*>& faceLayers = ((WXFace*)(*f))->getSmoothLayers();
-               for (vector<WXFaceLayer*>::iterator wxfl = faceLayers.begin(), wxflend = faceLayers.end();
+       for (vector<WFace *>::iterator f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
+               vector<WXFaceLayer *>& faceLayers = ((WXFace *)(*f))->getSmoothLayers();
+               for (vector<WXFaceLayer *>::iterator wxfl = faceLayers.begin(), wxflend = faceLayers.end();
                     wxfl != wxflend;
                     ++wxfl)
                {
@@ -749,10 +750,10 @@ void FEdgeXDetector::buildSmoothEdges(WXShape *iShape)
        }
 
        if (hasSmoothEdges && !_computeRidgesAndValleys && !_computeSuggestiveContours) {
-               vector<WVertex*>& wvertices = iShape->getVertexList();
+               vector<WVertex *>& wvertices = iShape->getVertexList();
                for (vector<WVertex*>::iterator wv = wvertices.begin(), wvend = wvertices.end(); wv != wvend; ++wv) {
                        // Compute curvatures
-                       WXVertex *wxv = dynamic_cast<WXVertex*>(*wv);
+                       WXVertex *wxv = dynamic_cast<WXVertex *>(*wv);
                        computeCurvatures(wxv);
                }
                _meanK1 /= (real)(_nPoints);
index 1b211264402614124667291f303b99a4c82e5cdc..5df9423b4cf9554000c48d10fc92d8d2705bae45 100644 (file)
@@ -174,7 +174,7 @@ public:
        {
                if (b != _faceSmoothness) {
                        _faceSmoothness = b;
-                       _changes=true;
+                       _changes = true;
                }
        }
 
@@ -182,7 +182,7 @@ public:
        {
                if (b != _faceMarks) {
                        _faceMarks = b;
-                       _changes=true;
+                       _changes = true;
                }
        }
 
@@ -194,7 +194,7 @@ public:
        {
                if (r != _sphereRadius) {
                        _sphereRadius = r;
-                       _changes=true;
+                       _changes = true;
                }
        }
 
index 9e8557b0fd34537deec17e0a486de66e409560e9..527d67cee2a1f680e82cf835af31f5c9c8cb87f5 100644 (file)
@@ -302,9 +302,9 @@ int MaterialF0D::operator()(Interface0DIterator& iter)
        if (fe1 == NULL)
                return -1;
        if (fe1->isSmooth())
-               result = ((FEdgeSmooth*)fe1)->frs_material();
+               result = ((FEdgeSmooth *)fe1)->frs_material();
        else
-               result = ((FEdgeSharp*)fe1)->bFrsMaterial();
+               result = ((FEdgeSharp *)fe1)->bFrsMaterial();
 #if 0
        const SShape *sshape = getShapeF0D(iter);
        return sshape->material();
index f17a568ffee850cc2a9d0fb636dafd8c37b57676..e8f18fe807757efd74790a82cbae6dd49f35360b 100644 (file)
@@ -155,7 +155,7 @@ int IncrementChainingTimeStampF1D::operator()(Interface1D& inter)
 {
        ViewEdge *ve = dynamic_cast<ViewEdge*>(&inter);
        if (ve)
-               ve->setChainingTimeStamp(ve->getChainingTimeStamp()+1);
+               ve->setChainingTimeStamp(ve->getChainingTimeStamp() + 1);
        return 0;
 }
 
index 5fe7d095358f3d5f0778488d252e1f627514a56b..930bb0af2009fb31e31cf78db03861d152ff31ad 100644 (file)
@@ -93,8 +93,8 @@ public:
                        }
                }
                if (G.debug & G_DEBUG_FREESTYLE) {
-                       cout << "Proscenium: (" << proscenium[0] << ", " << proscenium[1] << ", " << proscenium[2]
-                            << ", " << proscenium[3] << ")" << endl;
+                       cout << "Proscenium: (" << proscenium[0] << ", " << proscenium[1] << ", " << proscenium[2] <<
+                               ", " << proscenium[3] << ")" << endl;
                }
        }
 
@@ -118,8 +118,8 @@ public:
                proscenium[3] = std::max(minPoint[1], maxPoint[1]);
                if (G.debug & G_DEBUG_FREESTYLE) {
                        cout << "Bounding box: " << minPoint << " to " << maxPoint << endl;
-                       cout << "Proscenium  : " << proscenium[0] << ", " << proscenium[1] << ", " << proscenium[2] << ", "
-                            << proscenium[3] << endl;
+                       cout << "Proscenium  : " << proscenium[0] << ", " << proscenium[1] << ", " << proscenium[2] << ", " <<
+                               proscenium[3] << endl;
                }
        }
 
@@ -133,8 +133,8 @@ protected:
 class GridDensityProviderFactory
 {
        // Disallow copying and assignment
-       GridDensityProviderFactory (const GridDensityProviderFactory& other);
-       GridDensityProviderFactory& operator= (const GridDensityProviderFactory& other);
+       GridDensityProviderFactory(const GridDensityProviderFactory& other);
+       GridDensityProviderFactory& operator=(const GridDensityProviderFactory& other);
 
 public:
        GridDensityProviderFactory() {}
index bbf93deadb715980c41a93fe3b0378d2368fbd06..f7c814a63d8277922c202a3063dd2077401bc26b 100644 (file)
@@ -133,7 +133,7 @@ public:
        }
 
        /*! Returns the FEdge that lies between this Interface0D and the Interface0D given as argument. */
-       virtual FEdgegetFEdge(Interface0D&)
+       virtual FEdge *getFEdge(Interface0D&)
        {
                PyErr_SetString(PyExc_TypeError, "method getFEdge() not properly overridden");
                return 0;
@@ -162,7 +162,7 @@ public:
        }
 
        /*! Cast the Interface0D in ViewVertex if it can be. */
-       virtual ViewVertex * castToViewVertex()
+       virtual ViewVertex *castToViewVertex()
        {
                PyErr_SetString(PyExc_TypeError, "method castToViewVertex() not properly overridden");
                return 0;
@@ -201,7 +201,7 @@ public:
 
        virtual Interface0D& operator*() = 0;
 
-       virtual Interface0Doperator->()
+       virtual Interface0D *operator->()
        {
                return &(operator*());
        }
@@ -227,7 +227,7 @@ public:
        /*! Returns the point parameter 0<u<1 */
        virtual float u() const = 0;
 
-       virtual Interface0DIteratorNestedcopy() const = 0;
+       virtual Interface0DIteratorNested *copy() const = 0;
 };
 
 
@@ -245,7 +245,7 @@ public:
 class Interface0DIterator : public Iterator
 {
 public:
-       Interface0DIterator(Interface0DIteratorNestedit = NULL)
+       Interface0DIterator(Interface0DIteratorNested *it = NULL)
        {
                _iterator = it;
        }
@@ -270,7 +270,7 @@ public:
         */
        Interface0DIterator& operator=(const Interface0DIterator& it)
        {
-               if(_iterator)
+               if (_iterator)
                        delete _iterator;
                _iterator = it._iterator->copy();
                return *this;
index 0cbad57b44a8e370ab62b127f52d95632f70e5fa..b9fd5a3ebffee3794a638fed425690d199abfd37 100644 (file)
@@ -76,7 +76,8 @@ void OccluderSource::begin()
        }
 }
 
-bool OccluderSource::next() {
+bool OccluderSource::next()
+{
        if (valid) {
                ++currentFace;
                while (currentFace == facesEnd) {
@@ -130,8 +131,8 @@ void OccluderSource::getOccluderProscenium(real proscenium[4])
                next();
        }
        if (G.debug & G_DEBUG_FREESTYLE) {
-               cout << "Proscenium: (" << proscenium[0] << ", " << proscenium[1] << ", " << proscenium[2] << ", "
-                    << proscenium[3] << ")" << endl;
+               cout << "Proscenium: (" << proscenium[0] << ", " << proscenium[1] << ", " << proscenium[2] << ", " <<
+                       proscenium[3] << ")" << endl;
        }
 }
 
index 104040fd2a5f493232192072ab73dbbedcb080e6..f71c58c320c23c12a7c58057cc7655d300b8da89 100644 (file)
@@ -173,7 +173,9 @@ FEdge *SVertex::getFEdge(Interface0D& inter)
        for (; fe != feend; ++fe) {
                if ((((*fe)->vertexA() == this) && ((*fe)->vertexB() == iVertexB)) ||
                    (((*fe)->vertexB() == this) && ((*fe)->vertexA() == iVertexB)))
+               {
                        result = (*fe);
+               }
        }
        if ((result == 0) && (getNature() & Nature::T_VERTEX)) {
                SVertex *brother;
@@ -187,7 +189,9 @@ FEdge *SVertex::getFEdge(Interface0D& inter)
                        for (fe = fedges.begin(), feend = fedges.end(); fe != feend; ++fe) {
                                if ((((*fe)->vertexA() == brother) && ((*fe)->vertexB() == iVertexB)) ||
                                    (((*fe)->vertexB() == brother) && ((*fe)->vertexA() == iVertexB)))
+                               {
                                        result = (*fe);
+                               }
                        }
                }
        }
@@ -202,7 +206,9 @@ FEdge *SVertex::getFEdge(Interface0D& inter)
                        for (fe = _FEdges.begin(), feend = _FEdges.end(); fe != feend; ++fe) {
                                if ((((*fe)->vertexA() == this) && ((*fe)->vertexB() == brother)) ||
                                    (((*fe)->vertexB() == this) && ((*fe)->vertexA() == brother)))
+                               {
                                        result = (*fe);
+                               }
                        }
                }
        }
index 2efe111add5b18ae06933c89079931b0be69384a..8f37532191e7c5373965157b1733ad0e422046c8 100644 (file)
@@ -377,8 +377,8 @@ public:
        /* replaces edge 1 by edge 2 in the list of edges */
        inline void Replace(FEdge *e1, FEdge *e2)
        {
-               vector<FEdge*>::iterator insertedfe;
-               for (vector<FEdge*>::iterator fe = _FEdges.begin(),fend = _FEdges.end(); fe != fend; fe++) {
+               vector<FEdge *>::iterator insertedfe;
+               for (vector<FEdge *>::iterator fe = _FEdges.begin(), fend = _FEdges.end(); fe != fend; fe++) {
                        if ((*fe) == e1) {
                                insertedfe = _FEdges.insert(fe, e2);// inserts e2 before fe.
                                // returns an iterator pointing toward e2. fe is invalidated.
@@ -591,13 +591,13 @@ public:
        }
 
        /*! Returns the second SVertex. */
-       inline SVertexvertexB()
+       inline SVertex *vertexB()
        {
                return _VertexB;
        }
 
        /*! Returns the first SVertex if i=0, the seccond SVertex if i=1. */
-       inline SVertexoperator[](const unsigned short int& i) const
+       inline SVertex *operator[](const unsigned short int& i) const
        {
                return (i % 2 == 0) ? _VertexA : _VertexB;
        }
@@ -1429,7 +1429,7 @@ public:
                vector<FEdge*>::iterator fe, fend;
                vector<FEdge*>& fedges = iBrother.getChains();
                for (fe = fedges.begin(), fend = fedges.end(); fe != fend; fe++) {
-                       _chains.push_back((FEdge*)((*fe)->userdata));
+                       _chains.push_back((FEdge *)((*fe)->userdata));
                }
 
                //-------------------------
@@ -1443,7 +1443,7 @@ public:
                             fed++)
                        {
                                FEdge *current = *fed;
-                               newfedgelist.push_back((FEdge*)current->userdata);
+                               newfedgelist.push_back((FEdge *)current->userdata);
                        }
                        (*sv)->setFEdges(newfedgelist);
                }
@@ -1452,10 +1452,10 @@ public:
                // remap vertices and nextedge in edges:
                //-------------------------------------
                for (e = _edgesList.begin(), eend = _edgesList.end(); e != eend; e++) {
-                       (*e)->setVertexA((SVertex*)((*e)->vertexA()->userdata));
-                       (*e)->setVertexB((SVertex*)((*e)->vertexB()->userdata));
-                       (*e)->setNextEdge((FEdge*)((*e)->nextEdge()->userdata));
-                       (*e)->setPreviousEdge((FEdge*)((*e)->previousEdge()->userdata));
+                       (*e)->setVertexA((SVertex *)((*e)->vertexA()->userdata));
+                       (*e)->setVertexB((SVertex *)((*e)->vertexB()->userdata));
+                       (*e)->setNextEdge((FEdge *)((*e)->nextEdge()->userdata));
+                       (*e)->setPreviousEdge((FEdge *)((*e)->previousEdge()->userdata));
                }
 
                // reset all brothers userdata to NULL:
@@ -1476,7 +1476,7 @@ public:
        }
 
        /*! Cloning method. */
-       virtual SShape * duplicate()
+       virtual SShape *duplicate()
        {
                SShape *clone = new SShape(*this);
                return clone;
@@ -1564,7 +1564,7 @@ public:
                Vec3r a = ioA->point2D();
                Vec3r b = ioB->point2D();
 
-               Vec3r newpoint3d,newpoint2d;
+               Vec3r newpoint3d, newpoint2d;
                vector<SVertex*> intersections;
                real t, T;
                for (vector<Vec2r>::const_iterator p = iParameters.begin(), pend = iParameters.end(); p != pend; p++) {
@@ -1709,7 +1709,7 @@ public:
                ioEdge->setVertexB(ioNewVertex);
 
                if (ioEdge->isSmooth()) {
-                       ((FEdgeSmooth*)newEdge)->setFace(((FEdgeSmooth*)ioEdge)->face());
+                       ((FEdgeSmooth *)newEdge)->setFace(((FEdgeSmooth *)ioEdge)->face());
                }
 
                return newEdge;
index d6ee159fe88ed9d7edd0df2589deeb04b9ea29ef..f1c6b25c49efb87e8b5d1c07e92cac14a29145ef 100644 (file)
@@ -80,7 +80,7 @@ public:
        /*! retrieves an instance on the singleton */
        static SilhouetteGeomEngine *getInstance()
        {
-               if(0 == _pInstance) {
+               if (_pInstance == NULL) {
                        _pInstance = new SilhouetteGeomEngine;
                }
                return _pInstance;
index 4582fb40b61570a807f4c9198aee8ea038d680cb..2cd8e5ebe660bd1afbefe5fbde1a0d9657a5720d 100644 (file)
@@ -84,9 +84,9 @@ SphericalGrid::Iterator::Iterator(SphericalGrid& grid, Vec3r& center, real epsil
        _cell = grid.findCell(_target);
        #if SPHERICAL_GRID_LOGGING
                if (G.debug & G_DEBUG_FREESTYLE) {
-                       cout << "Searching for occluders of edge centered at " << _target << " in cell ["
-                            << _cell->boundary[0] << ", " << _cell->boundary[1] << ", " << _cell->boundary[2]
-                            << ", " << _cell->boundary[3] << "] (" << _cell->faces.size() << " occluders)" << endl;
+                       cout << "Searching for occluders of edge centered at " << _target << " in cell [" <<
+                               _cell->boundary[0] << ", " << _cell->boundary[1] << ", " << _cell->boundary[2] <<
+                               ", " << _cell->boundary[3] << "] (" << _cell->faces.size() << " occluders)" << endl;
                }
        #endif
 
@@ -157,7 +157,7 @@ void SphericalGrid::assignCells(OccluderSource& source, GridDensityProvider& den
                                height = _cellSize;
 
                                // Initialize cell
-                               Cellb = _cells[i * _cellsY + j] = new Cell();
+                               Cell *b = _cells[i * _cellsY + j] = new Cell();
                                b->setDimensions(x, y, width, height);
                        }
                }
index 57ed117a93583d9fcb288845c7cf3445730740e4..774ec9ab517fafa980ccdb696d893f9fd0e1c3bc 100644 (file)
@@ -193,21 +193,21 @@ inline void SphericalGrid::Iterator::initBeforeTarget()
 inline void SphericalGrid::Iterator::initAfterTarget()
 {
        if (_foundOccludee) {
-               #if SPHERICAL_GRID_LOGGING
-                       if (G.debug & G_DEBUG_FREESTYLE) {
-                               std::cout << "\tStarting occludee search from occludeeCandidate at depth "
-                                         << _occludeeDepth << std::endl;
-                       }
-               #endif
+#if SPHERICAL_GRID_LOGGING
+               if (G.debug & G_DEBUG_FREESTYLE) {
+                       std::cout << "\tStarting occludee search from occludeeCandidate at depth " <<
+                                    _occludeeDepth << std::endl;
+               }
+#endif
                _current = _occludeeCandidate;
                return;
        }
 
-       #if SPHERICAL_GRID_LOGGING
-               if (G.debug & G_DEBUG_FREESTYLE) {
-                       std::cout << "\tStarting occludee search from current position" << std::endl;
-               }
-       #endif
+#if SPHERICAL_GRID_LOGGING
+       if (G.debug & G_DEBUG_FREESTYLE) {
+               std::cout << "\tStarting occludee search from current position" << std::endl;
+       }
+#endif
 
        while (_current != _cell->faces.end() && !testOccluder(true)) {
                ++_current;
@@ -222,23 +222,23 @@ inline bool SphericalGrid::Iterator::testOccluder(bool wantOccludee)
                // _current=_cell->face.end() will make the calling routine give up.
                return true;
        }
-       #if SPHERICAL_GRID_LOGGING
-               if (G.debug & G_DEBUG_FREESTYLE) {
-                       std::cout << "\tTesting occluder " << (*_current)->poly.getVertices()[0];
-                       for (unsigned int i = 1; i < (*_current)->poly.getVertices().size(); ++i) {
-                               std::cout << ", " << (*_current)->poly.getVertices()[i];
-                       }
-                       std::cout << " from shape " << (*_current)->face->GetVertex(0)->shape()->GetId() << std::endl;
+#if SPHERICAL_GRID_LOGGING
+       if (G.debug & G_DEBUG_FREESTYLE) {
+               std::cout << "\tTesting occluder " << (*_current)->poly.getVertices()[0];
+               for (unsigned int i = 1; i < (*_current)->poly.getVertices().size(); ++i) {
+                       std::cout << ", " << (*_current)->poly.getVertices()[i];
                }
-       #endif
+               std::cout << " from shape " << (*_current)->face->GetVertex(0)->shape()->GetId() << std::endl;
+       }
+#endif
 
        // If we have an occluder candidate and we are unambiguously after it, abort
        if (_foundOccludee && (*_current)->shallowest > _occludeeDepth) {
-               #if SPHERICAL_GRID_LOGGING
-                       if (G.debug & G_DEBUG_FREESTYLE) {
-                               std::cout << "\t\tAborting: shallowest > occludeeCandidate->deepest" << std::endl;
-                       }
-               #endif
+#if SPHERICAL_GRID_LOGGING
+               if (G.debug & G_DEBUG_FREESTYLE) {
+                       std::cout << "\t\tAborting: shallowest > occludeeCandidate->deepest" << std::endl;
+               }
+#endif
                _current = _cell->faces.end();
 
                // See note above
@@ -248,21 +248,21 @@ inline bool SphericalGrid::Iterator::testOccluder(bool wantOccludee)
        // Specific continue or stop conditions when searching for each type
        if (wantOccludee) {
                if ((*_current)->deepest < _target[2]) {
-                       #if SPHERICAL_GRID_LOGGING
-                               if (G.debug & G_DEBUG_FREESTYLE) {
-                                       std::cout << "\t\tSkipping: shallower than target while looking for occludee" << std::endl;
-                               }
-                       #endif
+#if SPHERICAL_GRID_LOGGING
+                       if (G.debug & G_DEBUG_FREESTYLE) {
+                               std::cout << "\t\tSkipping: shallower than target while looking for occludee" << std::endl;
+                       }
+#endif
                        return false;
                }
        }
        else {
                if ((*_current)->shallowest > _target[2]) {
-                       #if SPHERICAL_GRID_LOGGING
-                               if (G.debug & G_DEBUG_FREESTYLE) {
-                                       std::cout << "\t\tStopping: deeper than target while looking for occluder" << std::endl;
-                               }
-                       #endif
+#if SPHERICAL_GRID_LOGGING
+                       if (G.debug & G_DEBUG_FREESTYLE) {
+                               std::cout << "\t\tStopping: deeper than target while looking for occluder" << std::endl;
+                       }
+#endif
                        return true;
                }
        }
@@ -273,11 +273,11 @@ inline bool SphericalGrid::Iterator::testOccluder(bool wantOccludee)
        Vec3r bbMin, bbMax;
        (*_current)->poly.getBBox(bbMin, bbMax);
        if (_target[0] < bbMin[0] || _target[0] > bbMax[0] || _target[1] < bbMin[1] || _target[1] > bbMax[1]) {
-               #if SPHERICAL_GRID_LOGGING
-                       if (G.debug & G_DEBUG_FREESTYLE) {
-                               std::cout << "\t\tSkipping: bounding box violation" << std::endl;
-                       }
-               #endif
+#if SPHERICAL_GRID_LOGGING
+               if (G.debug & G_DEBUG_FREESTYLE) {
+                       std::cout << "\t\tSkipping: bounding box violation" << std::endl;
+               }
+#endif
                return false;
        }
 
@@ -291,28 +291,28 @@ inline void SphericalGrid::Iterator::reportDepth(Vec3r origin, Vec3r u, real t)
        // If origin is the viewpoint, depth == t. A future optimization could allow the caller to tell us if origin is
        // viewponit or target, at the cost of changing the OptimizedGrid API.
        real depth = (origin + u * t).norm();
-       #if SPHERICAL_GRID_LOGGING
+#if SPHERICAL_GRID_LOGGING
+       if (G.debug & G_DEBUG_FREESTYLE) {
+               std::cout << "\t\tReporting depth of occluder/ee: " << depth;
+       }
+#endif
+       if (depth > _target[2]) {
+#if SPHERICAL_GRID_LOGGING
                if (G.debug & G_DEBUG_FREESTYLE) {
-                       std::cout << "\t\tReporting depth of occluder/ee: " << depth;
+                       std::cout << " is deeper than target" << std::endl;
                }
-       #endif
-       if (depth > _target[2]) {
-               #if SPHERICAL_GRID_LOGGING
-                       if (G.debug & G_DEBUG_FREESTYLE) {
-                               std::cout << " is deeper than target" << std::endl;
-                       }
-               #endif
+#endif
                // If the current occluder is the best occludee so far, save it.
                if (! _foundOccludee || _occludeeDepth > depth) {
                        markCurrentOccludeeCandidate(depth);
                } 
        }
        else {
-               #if SPHERICAL_GRID_LOGGING
-                       if (G.debug & G_DEBUG_FREESTYLE) {
-                               std::cout << std::endl;
-                       }
-               #endif
+#if SPHERICAL_GRID_LOGGING
+               if (G.debug & G_DEBUG_FREESTYLE) {
+                       std::cout << std::endl;
+               }
+#endif
        }
 }
 
@@ -346,11 +346,11 @@ inline bool SphericalGrid::Iterator::validAfterTarget()
 
 inline void SphericalGrid::Iterator::markCurrentOccludeeCandidate(real depth)
 {
-       #if SPHERICAL_GRID_LOGGING
-               if (G.debug & G_DEBUG_FREESTYLE) {
-                       std::cout << "\t\tFound occludeeCandidate at depth " << depth << std::endl;
-               }
-       #endif
+#if SPHERICAL_GRID_LOGGING
+       if (G.debug & G_DEBUG_FREESTYLE) {
+               std::cout << "\t\tFound occludeeCandidate at depth " << depth << std::endl;
+       }
+#endif
        _occludeeCandidate = _current;
        _occludeeDepth = depth;
        _foundOccludee = true;
index 120ef46667b126e5449296fbaa6086c5b3ae5d99..98345b396f4d8f5031adc00207124c54e3fec5d9 100644 (file)
@@ -25,7 +25,7 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/freestyle/intern/view_map/SteerbaleViewMap.cpp
+/** \file blender/freestyle/intern/view_map/SteerableViewMap.cpp
  *  \ingroup freestyle
  *  \brief Convenient access to the steerable ViewMap to which any element of the ViewMap belongs to.
  *  \author Stephane Grabli
@@ -57,7 +57,7 @@ using namespace Geometry;
 SteerableViewMap::SteerableViewMap(unsigned int nbOrientations)
 {
        _nbOrientations = nbOrientations;
-       _bound = cos(M_PI/(float)_nbOrientations);
+       _bound = cos(M_PI / (float)_nbOrientations);
        for (unsigned int i = 0; i < _nbOrientations; ++i) {
                _directions.push_back(Vec2d(cos((float)i * M_PI / (float)_nbOrientations),
                                            sin((float)i * M_PI / (float)_nbOrientations)));
@@ -67,7 +67,7 @@ SteerableViewMap::SteerableViewMap(unsigned int nbOrientations)
 
 void SteerableViewMap::Build()
 {
-       _imagesPyramids = new ImagePyramid * [_nbOrientations + 1]; // one more map to store the complete visible VM
+       _imagesPyramids = new ImagePyramid *[_nbOrientations + 1]; // one more map to store the complete visible VM
        memset((_imagesPyramids), 0, (_nbOrientations + 1) * sizeof(ImagePyramid *));
 }
 
@@ -78,7 +78,7 @@ SteerableViewMap::SteerableViewMap(const SteerableViewMap& iBrother)
        _bound = iBrother._bound;
        _directions = iBrother._directions;
        _mapping = iBrother._mapping;
-       _imagesPyramids = new ImagePyramid * [_nbOrientations + 1]; // one more map to store the complete visible VM
+       _imagesPyramids = new ImagePyramid *[_nbOrientations + 1]; // one more map to store the complete visible VM
        for (i = 0; i < _nbOrientations + 1; ++i)
                _imagesPyramids[i] = new GaussianPyramid(*(dynamic_cast<GaussianPyramid*>(iBrother._imagesPyramids[i])));
 }
@@ -128,7 +128,7 @@ double *SteerableViewMap::AddFEdge(FEdge *iFEdge)
 {
        unsigned i;
        unsigned id = iFEdge->getId().getFirst();
-       map<unsigned int, double>::iterator o = _mapping.find(id);
+       map<unsigned int, double *>::iterator o = _mapping.find(id);
        if (o != _mapping.end()) {
                return (*o).second;
        }
@@ -174,7 +174,7 @@ unsigned SteerableViewMap::getSVMNumber(const Vec2f& orient)
 
 unsigned SteerableViewMap::getSVMNumber(unsigned id)
 {
-       map<unsigned int, double>::iterator o = _mapping.find(id);
+       map<unsigned int, double *>::iterator o = _mapping.find(id);
        if (o != _mapping.end()) {
                double *wvalues = (*o).second;
                double maxw = 0.0; 
@@ -241,8 +241,8 @@ void SteerableViewMap::saveSteerableViewMap() const
 {
        for (unsigned int i = 0; i <= _nbOrientations; ++i) {
                if (_imagesPyramids[i] == 0) {
-                       cerr << "SteerableViewMap warning: orientation " << i
-                            << " of steerable View Map whas not been computed yet" << endl;
+                       cerr << "SteerableViewMap warning: orientation " << i <<
+                               " of steerable View Map whas not been computed yet" << endl;
                        continue;
                }
                int ow = _imagesPyramids[i]->width(0);
@@ -267,8 +267,8 @@ void SteerableViewMap::saveSteerableViewMap() const
                                        //int c = (int)(_imagesPyramids[i]->pixel(x, y, j));
 
                                        //soc qtmp.setPixel(x, y, qRgb(c, c, c));
-                                       pix = (char*)ibuf->rect + y * rowbytes + x * 4;
-                                       pix[0] = pix [1] = pix[2] = c;
+                                       pix = (char *)ibuf->rect + y * rowbytes + x * 4;
+                                       pix[0] = pix[1] = pix[2] = c;
                                }
                        }
 
index a4a67c3fa7eaf64202ce8cae62f765d02192e97d..28504350ac5a8f017508f5db7d625d101c3693fa 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef __FREESTYLE_STEERABLE_VIEW_MAP_H__
 #define __FREESTYLE_STEERABLE_VIEW_MAP_H__
 
-/** \file blender/freestyle/intern/view_map/SteerbaleViewMap.h
+/** \file blender/freestyle/intern/view_map/SteerableViewMap.h
  *  \ingroup freestyle
  *  \brief Convenient access to the steerable ViewMap to which any element of the ViewMap belongs to.
  *  \author Stephane Grabli
index 56c32d8e134cdd24110057084e423c0296c5495a..537688e4c44046336ea6d1f817ec9bb1a37e3777 100644 (file)
@@ -203,8 +203,8 @@ ViewEdge *ViewEdgeXBuilder::BuildSmoothViewEdge(const OWXFaceLayer& iFaceLayer)
                ViewVertex *vva = MakeViewVertex(fefirst->vertexA());
                ViewVertex *vvb = MakeViewVertex(fe->vertexB());
 
-               ((NonTVertex*)vva)->AddOutgoingViewEdge(newVEdge);
-               ((NonTVertex*)vvb)->AddIncomingViewEdge(newVEdge);
+               ((NonTVertex *)vva)->AddOutgoingViewEdge(newVEdge);
+               ((NonTVertex *)vvb)->AddIncomingViewEdge(newVEdge);
 
                newVEdge->setA(vva);
                newVEdge->setB(vvb);
@@ -284,8 +284,8 @@ ViewEdge *ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge& iWEdge)
                ViewVertex *vva = MakeViewVertex(fefirst->vertexA());
                ViewVertex *vvb = MakeViewVertex(fe->vertexB());
 
-               ((NonTVertex*)vva)->AddOutgoingViewEdge(newVEdge);
-               ((NonTVertex*)vvb)->AddIncomingViewEdge(newVEdge);
+               ((NonTVertex *)vva)->AddOutgoingViewEdge(newVEdge);
+               ((NonTVertex *)vvb)->AddIncomingViewEdge(newVEdge);
 
                newVEdge->setA(vva);
                newVEdge->setB(vvb);
@@ -345,7 +345,7 @@ OWXFaceLayer ViewEdgeXBuilder::FindNextFaceLayer(const OWXFaceLayer& iFaceLayer)
                        return OWXFaceLayer(NULL, true);
                // if the next face layer has either no smooth edge or no smooth edge of same nature, no next face
                if (!nextFace->hasSmoothEdges())
-                       return OWXFaceLayer(NULL,true);
+                       return OWXFaceLayer(NULL, true);
                vector<WXFaceLayer*> sameNatureLayers;
                nextFace->retrieveSmoothEdgesLayers(iFaceLayer.fl->nature(), sameNatureLayers);
                // don't know how to deal with several edges of same nature on a single face
@@ -394,7 +394,7 @@ OWXFaceLayer ViewEdgeXBuilder::FindPreviousFaceLayer(const OWXFaceLayer& iFaceLa
                WVertex::face_iterator fend = previousVertex->faces_end();
                for (; (!found) && (f != fend); ++f) {
                        previousFace = dynamic_cast<WXFace*>(*f);
-                       if ((0 != previousFace) && (previousFace!=iFaceLayer.fl->getFace())) {
+                       if ((0 != previousFace) && (previousFace != iFaceLayer.fl->getFace())) {
                                vector<WXFaceLayer*> sameNatureLayers;
                                previousFace->retrieveSmoothEdgesLayers(iFaceLayer.fl->nature(), sameNatureLayers);
                                // don't know... Maybe should test whether this face has also a vertex_edge configuration
@@ -562,7 +562,7 @@ OWXEdge ViewEdgeXBuilder::FindNextWEdge(const OWXEdge& iEdge)
        else
                v = iEdge.e->GetaVertex();
 
-       if (((WXVertex*)v)->isFeature())
+       if (((WXVertex *)v)->isFeature())
                return 0; /* XXX eeek? NULL? OWXEdge(NULL, true/false)?*/
 
        int faceMarks = retrieveFaceMarks(iEdge.e);
@@ -605,13 +605,13 @@ OWXEdge ViewEdgeXBuilder::FindPreviousWEdge(const OWXEdge& iEdge)
        else
                v = iEdge.e->GetbVertex();
 
-       if (((WXVertex*)v)->isFeature())
+       if (((WXVertex *)v)->isFeature())
                return 0;
 
        int faceMarks = retrieveFaceMarks(iEdge.e);
-       vector<WEdge*>& vEdges = (v)->GetEdges();
-       for (vector<WEdge*>::iterator ve = vEdges.begin(), veend = vEdges.end(); ve != veend; ve++) {
-               WXEdge *wxe = dynamic_cast<WXEdge*>(*ve);
+       vector<WEdge *>& vEdges = (v)->GetEdges();
+       for (vector<WEdge *>::iterator ve = vEdges.begin(), veend = vEdges.end(); ve != veend; ve++) {
+               WXEdge *wxe = dynamic_cast<WXEdge *>(*ve);
                if (wxe == iEdge.e)
                        continue; // same edge as the one processed
 
index 2883919a85250944cc3416253b4e0d52020db194..024ab7eac5f6412bb8ffe8cbb96af0f29ccb39cf 100644 (file)
@@ -86,7 +86,7 @@ struct epsilonEquals
 
 
 // typedef hash_map<Vec3r, SVertex*, SVertexHasher, epsilonEquals> SVertexMap;
-typedef map<Vec3r , SVertex*> SVertexMap;
+typedef map<Vec3r, SVertex *> SVertexMap;
 
 class WXFaceLayer;
 
index 9f8b5e082005beab6509c8df98788e0336bd937f..7f8c797b5b997309c1ba3e5f0907d906ba181133 100644 (file)
@@ -162,24 +162,24 @@ ViewVertex *ViewMap::InsertViewVertex(SVertex *iVertex, vector<ViewEdge*>& newVi
                return vva;
        // because it is not already a ViewVertex, this SVertex must have only 2 FEdges. The incoming one still belongs
        // to ioEdge, the outgoing one now belongs to newVEdge
-       const vector<FEdge*>& fedges = iVertex->fedges();
+       const vector<FEdge *>& fedges = iVertex->fedges();
        if (fedges.size() != 2) {
                cerr << "ViewMap warning: Can't split the ViewEdge" << endl;
                return NULL;
        }
-       FEdge *fend(0), *fbegin(0);
-       for (vector<FEdge*>::const_iterator fe = fedges.begin(), feend = fedges.end(); fe != feend; ++fe) {
+       FEdge *fend(NULL), *fbegin(NULL);
+       for (vector<FEdge *>::const_iterator fe = fedges.begin(), feend = fedges.end(); fe != feend; ++fe) {
                if ((*fe)->vertexB() == iVertex) {
                        fend = (*fe);
                }
                if ((*fe)->vertexA() == iVertex) {
                        fbegin = (*fe);
                }
-               if ((fbegin!=0) && (fend!=0))
+               if ((fbegin != NULL) && (fend != NULL))
                        break;
        }
        ViewEdge *ioEdge = fbegin->viewedge();
-       ViewShape * vshape = ioEdge->viewShape();
+       ViewShape *vshape = ioEdge->viewShape();
        vva = new NonTVertex(iVertex);
        // if the ViewEdge is a closed loop, we don't create a new VEdge
        if (ioEdge->A() == 0) {
@@ -482,7 +482,8 @@ ViewVertexInternal::orientedViewEdgeIterator TVertex::edgesIterator(ViewEdge *iE
 /*                                */
 /**********************************/
 
-void NonTVertex::AddOutgoingViewEdge(ViewEdge *iVEdge){
+void NonTVertex::AddOutgoingViewEdge(ViewEdge *iVEdge)
+{
        // let's keep the viewedges ordered in CCW order in the 2D image plan
        directedViewEdge idve(iVEdge, false);
        if (!_ViewEdges.empty()) {
@@ -597,7 +598,7 @@ ViewEdge::edge_iterator ViewEdge::ViewEdge_iterator()
 
 ViewEdge::const_edge_iterator ViewEdge::ViewEdge_iterator() const
 {
-       return const_edge_iterator((ViewEdge*)this);
+       return const_edge_iterator((ViewEdge *)this);
 }
 
 //! feature edge iterator
index e29b2ae7cd689d832c7b6226936bd41c55dc0c3d..1dce71051ee62ffc3b0c42868b915d049c77fac5 100644 (file)
@@ -276,7 +276,7 @@ public: // Implementation of Interface0D
 
 public:
        friend class ViewShape;
-       typedef pair<ViewEdge*, bool> directedViewEdge; // if bool = true, the ViewEdge is incoming
+       typedef pair<ViewEdge *, bool> directedViewEdge; // if bool = true, the ViewEdge is incoming
 
        typedef vector<directedViewEdge> edges_container;
 
@@ -744,7 +744,7 @@ public:
        }
 
        /*! Builds a NonTVertex from a SVertex. */
-       inline NonTVertex(SVertexiSVertex) : ViewVertex(Nature::NON_T_VERTEX)
+       inline NonTVertex(SVertex *iSVertex) : ViewVertex(Nature::NON_T_VERTEX)
        {
                _SVertex = iSVertex;
                _SVertex->setViewVertex(this);
@@ -1401,8 +1401,8 @@ public:
        inline ViewShape(ViewShape& iBrother)
        {
                userdata = NULL;
-               vector<ViewVertex*>::iterator vv,vvend;
-               vector<ViewEdge*>::iterator ve, veend;
+               vector<ViewVertex *>::iterator vv, vvend;
+               vector<ViewEdge *>::iterator ve, veend;
 
                _SShape = iBrother._SShape;
 
@@ -1427,11 +1427,11 @@ public:
                        switch ((*vv)->getNature()) {
                                case Nature::T_VERTEX:
                                        {
-                                               TVertex *v = (TVertex*)(*vv);
-                                               ViewEdge *veFrontA = (ViewEdge*)(v)->frontEdgeA().first->userdata;
-                                               ViewEdge *veFrontB = (ViewEdge*)(v)->frontEdgeB().first->userdata;
-                                               ViewEdge *veBackA = (ViewEdge*)(v)->backEdgeA().first->userdata;
-                                               ViewEdge *veBackB = (ViewEdge*)(v)->backEdgeB().first->userdata;
+                                               TVertex *v = (TVertex *)(*vv);
+                                               ViewEdge *veFrontA = (ViewEdge *)(v)->frontEdgeA().first->userdata;
+                                               ViewEdge *veFrontB = (ViewEdge *)(v)->frontEdgeB().first->userdata;
+                                               ViewEdge *veBackA = (ViewEdge *)(v)->backEdgeA().first->userdata;
+                                               ViewEdge *veBackB = (ViewEdge *)(v)->backEdgeB().first->userdata;
 
                                                v->setFrontEdgeA(veFrontA, v->frontEdgeA().second);
                                                v->setFrontEdgeB(veFrontB, v->frontEdgeB().second);
@@ -1441,14 +1441,14 @@ public:
                                        break;
                                case Nature::NON_T_VERTEX:
                                        {
-                                               NonTVertex *v = (NonTVertex*)(*vv);
+                                               NonTVertex *v = (NonTVertex *)(*vv);
                                                vector<ViewVertex::directedViewEdge>& vedges = (v)->viewedges();
                                                vector<ViewVertex::directedViewEdge> newEdges;
                                                for (vector<ViewVertex::directedViewEdge>::iterator ve = vedges.begin(), veend = vedges.end();
                                                     ve != veend;
                                                     ve++)
                                                {
-                                                       ViewEdge *current = (ViewEdge*)((ve)->first)->userdata;
+                                                       ViewEdge *current = (ViewEdge *)((ve)->first)->userdata;
                                                        newEdges.push_back(ViewVertex::directedViewEdge(current, ve->second));
                                                }
                                                (v)->setViewEdges(newEdges);
@@ -1463,8 +1463,8 @@ public:
                // remap vertices in edges:
                //-------------------------------------
                for (ve = _Edges.begin(), veend = _Edges.end(); ve != veend; ve++) {
-                       (*ve)->setA((ViewVertex*)((*ve)->A()->userdata));
-                       (*ve)->setB((ViewVertex*)((*ve)->B()->userdata));
+                       (*ve)->setA((ViewVertex *)((*ve)->A()->userdata));
+                       (*ve)->setB((ViewVertex *)((*ve)->B()->userdata));
                        //---------------------------------------
                        // Update all embedded FEdges
                        //---------------------------------------
@@ -1757,7 +1757,7 @@ inline real ViewEdge::local_average_density(float sigma, int iCombination) const
 }
 #endif
 
-inline const SShape * ViewEdge::occluded_shape() const
+inline const SShape *ViewEdge::occluded_shape() const
 {
        if (0 == _aShape)
                return 0;
index ff6557b7d867aaa40c193c2cf0fa337f0d5a81dc..d7ed73ed795a83801fb2f232c29677e85c4e057f 100644 (file)
@@ -77,7 +77,7 @@ public:
 };
 
 template<class Traits>
-class edge_iterator_base : public IteratorBase<Traits,InputIteratorTag_Traits>
+class edge_iterator_base : public IteratorBase<Traits, InputIteratorTag_Traits>
 {
 public:
        typedef typename Traits::value_type value_type;
@@ -117,7 +117,7 @@ protected:
        edges_container_iterator _end;
        edges_container_iterator _nontvertex_iter;
 
-       typedef IteratorBase<Traits,InputIteratorTag_Traits> parent_class;
+       typedef IteratorBase<Traits, InputIteratorTag_Traits> parent_class;
 
 public:
        inline edge_iterator_base() : parent_class() {}
@@ -357,7 +357,7 @@ namespace ViewEdgeInternal {
 /*! Iterators definition */
 /*!----------------------*/
 template<class Traits>
-class edge_iterator_base : public IteratorBase<Traits,BidirectionalIteratorTag_Traits>
+class edge_iterator_base : public IteratorBase<Traits, BidirectionalIteratorTag_Traits>
 {
 public:
        typedef typename Traits::value_type value_type;
@@ -372,7 +372,7 @@ public:
        //friend class edge_iterator_base<Const_traits<ViewEdge*> >;
        value_type _first;
        bool _orientation;
-       typedef IteratorBase<Traits,BidirectionalIteratorTag_Traits> parent_class;
+       typedef IteratorBase<Traits, BidirectionalIteratorTag_Traits> parent_class;
 
 public:
        friend class ViewEdge;
@@ -510,7 +510,7 @@ protected:
 };
 
 template<class Traits>
-class fedge_iterator_base : public IteratorBase<Traits,BidirectionalIteratorTag_Traits>
+class fedge_iterator_base : public IteratorBase<Traits, BidirectionalIteratorTag_Traits>
 {
 public:
        typedef typename Traits::value_type value_type;
@@ -520,7 +520,7 @@ public:
        typedef fedge_iterator_base<Traits> Self;
 
 public:
-       typedef IteratorBase<Traits,BidirectionalIteratorTag_Traits> parent_class;
+       typedef IteratorBase<Traits, BidirectionalIteratorTag_Traits> parent_class;
        mutable value_type _FEdge;
        value_type _first;
        value_type _FEdgeB; // last fedge of the view edge
@@ -640,7 +640,7 @@ protected:
 };
 
 template<class Traits>
-class vertex_iterator_base : public IteratorBase<Traits,BidirectionalIteratorTag_Traits>
+class vertex_iterator_base : public IteratorBase<Traits, BidirectionalIteratorTag_Traits>
 {
 public:
        typedef typename Traits::value_type value_type;
@@ -650,7 +650,7 @@ public:
        typedef vertex_iterator_base<Traits> Self;
 
 protected:
-       typedef IteratorBase<Traits,BidirectionalIteratorTag_Traits> parent_class;
+       typedef IteratorBase<Traits, BidirectionalIteratorTag_Traits> parent_class;
 
 public:
        mutable value_type _SVertex;
index ea959bfd81dcea18c0f9eac9d4218925f7a224ad..6727a44465a1322eb549ff9d1aedcd9374ad19d0 100644 (file)
@@ -66,7 +66,7 @@ static void findOccludee(FEdge *fe, G& grid, I& occluders, real epsilon, WFace *
        WFace *face = NULL;
        if (fe->isSmooth()) {
                FEdgeSmooth *fes = dynamic_cast<FEdgeSmooth*>(fe);
-               face = (WFace*)fes->face();
+               face = (WFace *)fes->face();
        }
        WFace *oface;
        bool skipFace;
@@ -81,12 +81,12 @@ static void findOccludee(FEdge *fe, G& grid, I& occluders, real epsilon, WFace *
                real mint = FLT_MAX;
 
                for (occluders.initAfterTarget(); occluders.validAfterTarget(); occluders.nextOccludee()) {
-                       #if LOGGING
-                               if (_global.debug & G_DEBUG_FREESTYLE) {
-                                       cout << "\t\tEvaluating intersection for occludee " << occluders.getWFace() << " and ray " << A
-                                            << " * " << u << endl;
-                               }
-                       #endif
+#if LOGGING
+                       if (_global.debug & G_DEBUG_FREESTYLE) {
+                               cout << "\t\tEvaluating intersection for occludee " << occluders.getWFace() << " and ray " << A <<
+                                       " * " << u << endl;
+                       }
+#endif
                        oface = occluders.getWFace();
                        Polygon3r *p = occluders.getCameraSpacePolygon();
                        real d = -((p->getVertices())[0] * p->getNormal());
@@ -131,22 +131,22 @@ static void findOccludee(FEdge *fe, G& grid, I& occluders, real epsilon, WFace *
                                //first let us compute the plane equation.
                                if (GeomUtils::COINCIDENT == GeomUtils::intersectRayPlane(origin, edge, p->getNormal(), d, t, epsilon))
                                {
-                                       #if LOGGING
-                                               if (_global.debug & G_DEBUG_FREESTYLE) {
-                                                       cout << "\t\tRejecting occluder for target coincidence." << endl;
-                                               }
-                                       #endif
+#if LOGGING
+                                       if (_global.debug & G_DEBUG_FREESTYLE) {
+                                               cout << "\t\tRejecting occluder for target coincidence." << endl;
+                                       }
+#endif
                                        continue;
                                }
                        }
 
                        if (p->rayIntersect(A, v, t, t_u, t_v)) {
-                       #if LOGGING
-                               if (_global.debug & G_DEBUG_FREESTYLE) {
-                                       cout << "\t\tRay " << A << " * " << v << " intersects at time " << t << endl;
-                                       cout << "\t\t(v * normal) == " << (v * p->getNormal()) << " for normal " << p->getNormal() << endl;
-                               }
-                       #endif
+#if LOGGING
+                       if (_global.debug & G_DEBUG_FREESTYLE) {
+                               cout << "\t\tRay " << A << " * " << v << " intersects at time " << t << endl;
+                               cout << "\t\t(v * normal) == " << (v * p->getNormal()) << " for normal " << p->getNormal() << endl;
+                       }
+#endif
                        if (fabs(v * p->getNormal()) > 0.0001) {
                                if ((t > 0.0)) { // && (t<1.0))
                                        if (t < mint) {
@@ -154,11 +154,11 @@ static void findOccludee(FEdge *fe, G& grid, I& occluders, real epsilon, WFace *
                                                mint = t;
                                                noIntersection = false;
                                                fe->setOccludeeIntersection(Vec3r(A + t * v));
-                                               #if LOGGING
-                                                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                                                               cout << "\t\tIs occludee" << endl;
-                                                       }
-                                               #endif
+#if LOGGING
+                                               if (_global.debug & G_DEBUG_FREESTYLE) {
+                                                       cout << "\t\tIs occludee" << endl;
+                                               }
+#endif
                                        }
                                }
                        }
@@ -195,7 +195,7 @@ static void findOccludee(FEdge *fe, G& grid, real epsilon, ViewEdge *ve, WFace *
        WFace *face = NULL;
        if (fe->isSmooth()) {
                FEdgeSmooth *fes = dynamic_cast<FEdgeSmooth*>(fe);
-               face = (WFace*)fes->face();
+               face = (WFace *)fes->face();
        }
 
        if (face) {
@@ -236,7 +236,7 @@ static int computeVisibility(ViewMap *viewMap, FEdge *fe, G& grid, real epsilon,
        WFace *face = NULL;
        if (fe->isSmooth()) {
                FEdgeSmooth *fes = dynamic_cast<FEdgeSmooth*>(fe);
-               face = (WFace*)fes->face();
+               face = (WFace *)fes->face();
        }
        vector<WVertex*> faceVertices;
        WVertex::incoming_edge_iterator ie;
@@ -256,54 +256,53 @@ static int computeVisibility(ViewMap *viewMap, FEdge *fe, G& grid, real epsilon,
        oface = occluders.getWFace();
        Polygon3r *p = occluders.getCameraSpacePolygon();
        real t, t_u, t_v;
-       #if LOGGING
-               if (_global.debug & G_DEBUG_FREESTYLE) {
-                       cout << "\t\tEvaluating intersection for occluder " << (p->getVertices())[0] << (p->getVertices())[1]
-                            << (p->getVertices())[2] << endl << "\t\t\tand ray " << vp << " * " << u << " (center " << center << ")"
-                            << endl;
-               }
-       #endif
-
-       #if LOGGING
-               Vec3r v(vp - center);
-               real rl = v.norm();
-               v.normalize();
-               vector<Vec3r> points;
-               // Iterate over vertices, storing projections in points
-               for (vector<WOEdge*>::const_iterator woe = oface->getEdgeList().begin(), woend = oface->getEdgeList().end();
-                    woe != woend;
-                    woe++)
-               {
-                       points.push_back(Vec3r((*woe)->GetaVertex()->GetVertex()));
-               }
-               Polygon3r p1(points, oface->GetNormal());
-               Vec3r v1((p1.getVertices())[0]);
-               real d = -(v1 * p->getNormal());
-               if (_global.debug & G_DEBUG_FREESTYLE) {
-                       cout << "\t\tp:  " << (p->getVertices())[0] << (p->getVertices())[1] << (p->getVertices())[2] << ", norm: "
-                            << p->getNormal() << endl;
-                       cout << "\t\tp1: " << (p1.getVertices())[0] << (p1.getVertices())[1] << (p1.getVertices())[2] << ", norm: "
-                            << p1.getNormal() << endl;
-               }
-       #else
-               real d = -((p->getVertices())[0] * p->getNormal());
-       #endif
+#if LOGGING
+       if (_global.debug & G_DEBUG_FREESTYLE) {
+               cout << "\t\tEvaluating intersection for occluder " << (p->getVertices())[0] << (p->getVertices())[1] <<
+                       (p->getVertices())[2] << endl << "\t\t\tand ray " << vp << " * " << u << " (center " << center <<
+                       ")" << endl;
+       }
+#endif
 
-       if (face)
+#if LOGGING
+       Vec3r v(vp - center);
+       real rl = v.norm();
+       v.normalize();
+       vector<Vec3r> points;
+       // Iterate over vertices, storing projections in points
+       for (vector<WOEdge*>::const_iterator woe = oface->getEdgeList().begin(), woend = oface->getEdgeList().end();
+                woe != woend;
+                woe++)
        {
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "\t\tDetermining face adjacency...";
-                       }
-               #endif
+               points.push_back(Vec3r((*woe)->GetaVertex()->GetVertex()));
+       }
+       Polygon3r p1(points, oface->GetNormal());
+       Vec3r v1((p1.getVertices())[0]);
+       real d = -(v1 * p->getNormal());
+       if (_global.debug & G_DEBUG_FREESTYLE) {
+               cout << "\t\tp:  " << (p->getVertices())[0] << (p->getVertices())[1] << (p->getVertices())[2] << ", norm: " <<
+                       p->getNormal() << endl;
+               cout << "\t\tp1: " << (p1.getVertices())[0] << (p1.getVertices())[1] << (p1.getVertices())[2] << ", norm: " <<
+                       p1.getNormal() << endl;
+       }
+#else
+       real d = -((p->getVertices())[0] * p->getNormal());
+#endif
+
+       if (face) {
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "\t\tDetermining face adjacency...";
+               }
+#endif
                skipFace = false;
 
                if (face == oface) {
-                       #if LOGGING
-                               if (_global.debug & G_DEBUG_FREESTYLE) {
-                                       cout << "  Rejecting occluder for face concurrency." << endl;
-                               }
-                       #endif
+#if LOGGING
+                       if (_global.debug & G_DEBUG_FREESTYLE) {
+                               cout << "  Rejecting occluder for face concurrency." << endl;
+                       }
+#endif
                        continue;
                }
 
@@ -330,11 +329,11 @@ static int computeVisibility(ViewMap *viewMap, FEdge *fe, G& grid, real epsilon,
                        break;
                }
                if (skipFace) {
-                       #if LOGGING
-                               if (_global.debug & G_DEBUG_FREESTYLE) {
-                                       cout << "  Rejecting occluder for face adjacency." << endl;
-                               }
-                       #endif
+#if LOGGING
+                       if (_global.debug & G_DEBUG_FREESTYLE) {
+                               cout << "  Rejecting occluder for face adjacency." << endl;
+                       }
+#endif
                        continue;
                }
        }
@@ -343,43 +342,43 @@ static int computeVisibility(ViewMap *viewMap, FEdge *fe, G& grid, real epsilon,
                //-------------------------------------------------------------
                //first let us compute the plane equation.
                if (GeomUtils::COINCIDENT == GeomUtils::intersectRayPlane(origin, edge, p->getNormal(), d, t, epsilon)) {
-                       #if LOGGING
-                               if (_global.debug & G_DEBUG_FREESTYLE) {
-                                       cout << "\t\tRejecting occluder for target coincidence." << endl;
-                               }
-                       #endif
+#if LOGGING
+                       if (_global.debug & G_DEBUG_FREESTYLE) {
+                               cout << "\t\tRejecting occluder for target coincidence." << endl;
+                       }
+#endif
                        continue;
                }
        }
 
-       #if LOGGING
-               if (_global.debug & G_DEBUG_FREESTYLE) {
-                       real x;
-                       if (p1.rayIntersect(center, v, x, t_u, t_v)) {
-                               cout << "\t\tRay should intersect at time " << (rl - x) << ". Center: " << center << ", V: " << v
-                                    <<  ", RL: " << rl << ", T:" << x << endl;
-                       }
-                       else {
-                               cout << "\t\tRay should not intersect. Center: " << center << ", V: " << v <<  ", RL: " << rl << endl;
-                       }
+#if LOGGING
+       if (_global.debug & G_DEBUG_FREESTYLE) {
+               real x;
+               if (p1.rayIntersect(center, v, x, t_u, t_v)) {
+                       cout << "\t\tRay should intersect at time " << (rl - x) << ". Center: " << center << ", V: " << v <<
+                               ", RL: " << rl << ", T:" << x << endl;
+               }
+               else {
+                       cout << "\t\tRay should not intersect. Center: " << center << ", V: " << v <<  ", RL: " << rl << endl;
                }
-       #endif
+       }
+#endif
 
        if (p->rayIntersect(center, u, t, t_u, t_v)) {
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "\t\tRay " << center << " * " << u << " intersects at time " << t << " (raylength is "
-                                    << raylength << ")" << endl;
-                               cout << "\t\t(u * normal) == " << (u * p->getNormal()) << " for normal " << p->getNormal() << endl;
-                       }
-               #endif
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "\t\tRay " << center << " * " << u << " intersects at time " << t << " (raylength is " <<
+                               raylength << ")" << endl;
+                       cout << "\t\t(u * normal) == " << (u * p->getNormal()) << " for normal " << p->getNormal() << endl;
+               }
+#endif
                if (fabs(u * p->getNormal()) > 0.0001) {
                        if ((t > 0.0) && (t < raylength)) {
-                               #if LOGGING
-                                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                                               cout << "\t\tIs occluder" << endl;
-                                       }
-                               #endif
+#if LOGGING
+                               if (_global.debug & G_DEBUG_FREESTYLE) {
+                                       cout << "\t\tIs occluder" << endl;
+                               }
+#endif
                                if ( foundOccluders != NULL ) {
                                        ViewShape *vshape = viewMap->viewShape(oface->GetVertex(0)->shape()->GetId());
                                        foundOccluders->insert(vshape);
@@ -425,21 +424,21 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, G& grid, real epsilo
        for (vector<ViewEdge*>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) {
                if (iRenderMonitor && iRenderMonitor->testBreak())
                        break;
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "Processing ViewEdge " << (*ve)->getId() << endl;
-                       }
-               #endif
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "Processing ViewEdge " << (*ve)->getId() << endl;
+               }
+#endif
                // Find an edge to test
                if (!(*ve)->isInImage()) {
                        // This view edge has been proscenium culled
                        (*ve)->setQI(255);
                        (*ve)->setaShape(0);
-                       #if LOGGING
-                               if (_global.debug & G_DEBUG_FREESTYLE) {
-                                       cout << "\tCulled." << endl;
-                               }
-                       #endif
+#if LOGGING
+                       if (_global.debug & G_DEBUG_FREESTYLE) {
+                               cout << "\tCulled." << endl;
+                       }
+#endif
                        continue;
                }
 
@@ -470,11 +469,11 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, G& grid, real epsilo
                        ++qiMajority;
                        qiMajority >>= 1;
                }
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "\tqiMajority: " << qiMajority << endl;
-                       }
-               #endif
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "\tqiMajority: " << qiMajority << endl;
+               }
+#endif
 
                tmpQI = 0;
                maxIndex = 0;
@@ -492,11 +491,11 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, G& grid, real epsilo
                        if ((maxCard < qiMajority)) {
                                //ARB: change &wFace to wFace and use reference in called function
                                tmpQI = computeVisibility<G, I>(ioViewMap, fe, grid, epsilon, *ve, &wFace, &foundOccluders);
-                               #if LOGGING
-                                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                                               cout << "\tFEdge: visibility " << tmpQI << endl;
-                                       }
-                               #endif
+#if LOGGING
+                               if (_global.debug & G_DEBUG_FREESTYLE) {
+                                       cout << "\tFEdge: visibility " << tmpQI << endl;
+                               }
+#endif
 
                                //ARB: This is an error condition, not an alert condition.
                                // Some sort of recovery or abort is necessary.
@@ -515,11 +514,11 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, G& grid, real epsilo
                                //ARB: FindOccludee is redundant if ComputeRayCastingVisibility has been called
                                //ARB: change &wFace to wFace and use reference in called function
                                findOccludee<G, I>(fe, grid, epsilon, *ve, &wFace);
-                               #if LOGGING
-                                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                                               cout << "\tFEdge: occludee only (" << (wFace != NULL ? "found" : "not found") << ")" << endl;
-                                       }
-                               #endif
+#if LOGGING
+                               if (_global.debug & G_DEBUG_FREESTYLE) {
+                                       cout << "\tFEdge: occludee only (" << (wFace != NULL ? "found" : "not found") << ")" << endl;
+                               }
+#endif
                        }
 
                        // Store test results
@@ -533,11 +532,11 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, G& grid, real epsilo
                                fe->setaFace(poly);
                                wFaces.push_back(wFace);
                                fe->setOccludeeEmpty(false);
-                               #if LOGGING
-                                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                                               cout << "\tFound occludee" << endl;
-                                       }
-                               #endif
+#if LOGGING
+                               if (_global.debug & G_DEBUG_FREESTYLE) {
+                                       cout << "\tFound occludee" << endl;
+                               }
+#endif
                        }
                        else {
                                fe->setOccludeeEmpty(true);
@@ -547,11 +546,11 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, G& grid, real epsilo
                        fe = fe->nextEdge();
                } while ((maxCard < qiMajority) && (fe) && (fe != festart));
 
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "\tFinished with " << nSamples << " samples, maxCard = " << maxCard << endl;
-                       }
-               #endif
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "\tFinished with " << nSamples << " samples, maxCard = " << maxCard << endl;
+               }
+#endif
 
                // ViewEdge
                // qi --
@@ -569,13 +568,13 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, G& grid, real epsilo
                for (set<ViewShape*>::iterator o = foundOccluders.begin(), oend = foundOccluders.end(); o != oend; ++o) {
                        (*ve)->AddOccluder((*o));
                }
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "\tConclusion: QI = " << maxIndex << ", " << (*ve)->occluders_size() << " occluders." << endl;
-                       }
-               #else
-                       (void)maxIndex;
-               #endif
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "\tConclusion: QI = " << maxIndex << ", " << (*ve)->occluders_size() << " occluders." << endl;
+               }
+#else
+               (void)maxIndex;
+#endif
                // occludee --
                if (!wFaces.empty()) {
                        if (wFaces.size() <= (float)nSamples / 2.0f) {
@@ -607,21 +606,21 @@ static void computeDetailedVisibility(ViewMap *ioViewMap, G& grid, real epsilon,
        for (vector<ViewEdge*>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) {
                if (iRenderMonitor && iRenderMonitor->testBreak())
                        break;
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "Processing ViewEdge " << (*ve)->getId() << endl;
-                       }
-               #endif
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "Processing ViewEdge " << (*ve)->getId() << endl;
+               }
+#endif
                // Find an edge to test
                if (!(*ve)->isInImage()) {
                        // This view edge has been proscenium culled
                        (*ve)->setQI(255);
                        (*ve)->setaShape(0);
-                       #if LOGGING
-                               if (_global.debug & G_DEBUG_FREESTYLE) {
-                                       cout << "\tCulled." << endl;
-                               }
-                       #endif
+#if LOGGING
+                       if (_global.debug & G_DEBUG_FREESTYLE) {
+                               cout << "\tCulled." << endl;
+                       }
+#endif
                        continue;
                }
 
@@ -652,11 +651,11 @@ static void computeDetailedVisibility(ViewMap *ioViewMap, G& grid, real epsilon,
                        ++qiMajority;
                        qiMajority >>= 1;
                }
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "\tqiMajority: " << qiMajority << endl;
-                       }
-               #endif
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "\tqiMajority: " << qiMajority << endl;
+               }
+#endif
 
                tmpQI = 0;
                maxIndex = 0;
@@ -674,11 +673,11 @@ static void computeDetailedVisibility(ViewMap *ioViewMap, G& grid, real epsilon,
                        if ((maxCard < qiMajority)) {
                                //ARB: change &wFace to wFace and use reference in called function
                                tmpQI = computeVisibility<G, I>(ioViewMap, fe, grid, epsilon, *ve, &wFace, &foundOccluders);
-                               #if LOGGING
-                                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                                               cout << "\tFEdge: visibility " << tmpQI << endl;
-                                       }
-                               #endif
+#if LOGGING
+                               if (_global.debug & G_DEBUG_FREESTYLE) {
+                                       cout << "\tFEdge: visibility " << tmpQI << endl;
+                               }
+#endif
 
                                //ARB: This is an error condition, not an alert condition.
                                // Some sort of recovery or abort is necessary.
@@ -697,11 +696,11 @@ static void computeDetailedVisibility(ViewMap *ioViewMap, G& grid, real epsilon,
                                //ARB: FindOccludee is redundant if ComputeRayCastingVisibility has been called
                                //ARB: change &wFace to wFace and use reference in called function
                                findOccludee<G, I>(fe, grid, epsilon, *ve, &wFace);
-                               #if LOGGING
-                                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                                               cout << "\tFEdge: occludee only (" << (wFace != NULL ? "found" : "not found") << ")" << endl;
-                                       }
-                               #endif
+#if LOGGING
+                               if (_global.debug & G_DEBUG_FREESTYLE) {
+                                       cout << "\tFEdge: occludee only (" << (wFace != NULL ? "found" : "not found") << ")" << endl;
+                               }
+#endif
                        }
 
                        // Store test results
@@ -715,11 +714,11 @@ static void computeDetailedVisibility(ViewMap *ioViewMap, G& grid, real epsilon,
                                fe->setaFace(poly);
                                wFaces.push_back(wFace);
                                fe->setOccludeeEmpty(false);
-                               #if LOGGING
-                                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                                               cout << "\tFound occludee" << endl;
-                                       }
-                               #endif
+#if LOGGING
+                               if (_global.debug & G_DEBUG_FREESTYLE) {
+                                       cout << "\tFound occludee" << endl;
+                               }
+#endif
                        }
                        else {
                                fe->setOccludeeEmpty(true);
@@ -729,11 +728,11 @@ static void computeDetailedVisibility(ViewMap *ioViewMap, G& grid, real epsilon,
                        fe = fe->nextEdge();
                } while ((maxCard < qiMajority) && (fe) && (fe != festart));
 
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "\tFinished with " << nSamples << " samples, maxCard = " << maxCard << endl;
-                       }
-               #endif
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "\tFinished with " << nSamples << " samples, maxCard = " << maxCard << endl;
+               }
+#endif
 
                // ViewEdge
                // qi --
@@ -744,11 +743,11 @@ static void computeDetailedVisibility(ViewMap *ioViewMap, G& grid, real epsilon,
                for (set<ViewShape*>::iterator o = foundOccluders.begin(), oend = foundOccluders.end(); o != oend; ++o) {
                        (*ve)->AddOccluder((*o));
                }
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "\tConclusion: QI = " << maxIndex << ", " << (*ve)->occluders_size() << " occluders." << endl;
-                       }
-               #endif
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "\tConclusion: QI = " << maxIndex << ", " << (*ve)->occluders_size() << " occluders." << endl;
+               }
+#endif
                // occludee --
                if (!wFaces.empty()) {
                        if (wFaces.size() <= (float)nSamples / 2.0f) {
@@ -960,7 +959,8 @@ void ViewMapBuilder::BuildGrid(WingedEdge& we, const BBox<Vec3r>& bbox, unsigned
        Vec3r size;
        for (unsigned int i = 0; i < 3; i++) {
                size[i] = fabs(bbox.getMax()[i] - bbox.getMin()[i]);
-               size[i] += size[i]/10.0; // let make the grid 1/10 bigger to avoid numerical errors while computing triangles/cells intersections
+               // let make the grid 1/10 bigger to avoid numerical errors while computing triangles/cells intersections.
+               size[i] += size[i] / 10.0;
                if (size[i] == 0) {
                        if (_global.debug & G_DEBUG_FREESTYLE) {
                                cout << "Warning: the bbox size is 0 in dimension " << i << endl;
@@ -1039,8 +1039,8 @@ void ViewMapBuilder::CullViewEdges(ViewMap *ioViewMap, real viewProscenium[4], r
        prosceniumOrigin[1] = (viewProscenium[3] - viewProscenium[2]) / 2.0;
        if (_global.debug & G_DEBUG_FREESTYLE) {
                cout << "Proscenium culling:" << endl;
-               cout << "Proscenium: [" << viewProscenium[0] << ", " << viewProscenium[1] << ", " << viewProscenium[2]
-                    << ", " << viewProscenium[3] << "]"<< endl;
+               cout << "Proscenium: [" << viewProscenium[0] << ", " << viewProscenium[1] << ", " << viewProscenium[2] <<
+                       ", " << viewProscenium[3] << "]"<< endl;
                cout << "Origin: [" << prosceniumOrigin[0] << ", " << prosceniumOrigin[1] << "]"<< endl;
        }
 
@@ -1263,7 +1263,7 @@ void ViewMapBuilder::computeCusps(ViewMap *ioViewMap)
                                        // creates and insert cusp
                                        cusp = dynamic_cast<NonTVertex*>(ioViewMap->InsertViewVertex(fes->vertexA(), newVEdges));
                                        if (cusp)
-                                               cusp->setNature(cusp->getNature()|Nature::CUSP);
+                                               cusp->setNature(cusp->getNature() | Nature::CUSP);
                                }
                        }
                        else {
@@ -1272,7 +1272,7 @@ void ViewMapBuilder::computeCusps(ViewMap *ioViewMap)
                                        positive = true;
                                        cusp = dynamic_cast<NonTVertex*>(ioViewMap->InsertViewVertex(fes->vertexA(), newVEdges));
                                        if (cusp)
-                                               cusp->setNature(cusp->getNature()|Nature::CUSP);
+                                               cusp->setNature(cusp->getNature() | Nature::CUSP);
                                }
                        }
                        fe = fe->nextEdge();
@@ -1351,7 +1351,7 @@ void ViewMapBuilder::ComputeDetailedVisibility(ViewMap *ioViewMap, WingedEdge& w
 void ViewMapBuilder::ComputeEdgesVisibility(ViewMap *ioViewMap, WingedEdge& we, const BBox<Vec3r>& bbox,
                                             unsigned int sceneNumFaces, visibility_algo iAlgo, real epsilon)
 {
-       switch(iAlgo) {
+       switch (iAlgo) {
                case ray_casting:
                        if (_global.debug & G_DEBUG_FREESTYLE) {
                                cout << "Using ordinary ray casting" << endl;
@@ -1469,11 +1469,11 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, real epsilo
        for (vector<ViewEdge*>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) {
                if (_pRenderMonitor && _pRenderMonitor->testBreak())
                        break;
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "Processing ViewEdge " << (*ve)->getId() << endl;
-                       }
-               #endif
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "Processing ViewEdge " << (*ve)->getId() << endl;
+               }
+#endif
                festart = (*ve)->fedgeA();
                fe = (*ve)->fedgeA();
                qiMajority = 1;
@@ -1482,11 +1482,11 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, real epsilo
                        fe = fe->nextEdge();
                } while (fe && fe != festart);
                qiMajority >>= 1;
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "\tqiMajority: " << qiMajority << endl;
-                       }
-               #endif
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "\tqiMajority: " << qiMajority << endl;
+               }
+#endif
 
                tmpQI = 0;
                maxIndex = 0;
@@ -1499,11 +1499,11 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, real epsilo
                        if ((maxCard < qiMajority)) {
                                tmpQI = ComputeRayCastingVisibility(fe, _Grid, epsilon, occluders, &aFace, timestamp++);
 
-                               #if LOGGING
-                                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                                               cout << "\tFEdge: visibility " << tmpQI << endl;
-                                       }
-                               #endif
+#if LOGGING
+                               if (_global.debug & G_DEBUG_FREESTYLE) {
+                                       cout << "\tFEdge: visibility " << tmpQI << endl;
+                               }
+#endif
                                //ARB: This is an error condition, not an alert condition.
                                // Some sort of recovery or abort is necessary.
                                if (tmpQI >= 256) {
@@ -1520,22 +1520,22 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, real epsilo
                        else {
                                //ARB: FindOccludee is redundant if ComputeRayCastingVisibility has been called
                                FindOccludee(fe, _Grid, epsilon, &aFace, timestamp++);
-                               #if LOGGING
-                                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                                               cout << "\tFEdge: occludee only (" << (aFace != NULL ? "found" : "not found") << ")" << endl;
-                                       }
-                               #endif
+#if LOGGING
+                               if (_global.debug & G_DEBUG_FREESTYLE) {
+                                       cout << "\tFEdge: occludee only (" << (aFace != NULL ? "found" : "not found") << ")" << endl;
+                               }
+#endif
                        }
 
                        if (aFace) {
                                fe->setaFace(*aFace);
                                aFaces.push_back(aFace);
                                fe->setOccludeeEmpty(false);
-                               #if LOGGING
-                                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                                               cout << "\tFound occludee" << endl;
-                                       }
-                               #endif
+#if LOGGING
+                               if (_global.debug & G_DEBUG_FREESTYLE) {
+                                       cout << "\tFound occludee" << endl;
+                               }
+#endif
                        }
                        else {
                                //ARB: We are arbitrarily using the last observed value for occludee (almost always the value observed
@@ -1547,11 +1547,11 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, real epsilo
                        ++nSamples;
                        fe = fe->nextEdge();
                } while ((maxCard < qiMajority) && (fe) && (fe != festart));
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "\tFinished with " << nSamples << " samples, maxCard = " << maxCard << endl;
-                       }
-               #endif
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "\tFinished with " << nSamples << " samples, maxCard = " << maxCard << endl;
+               }
+#endif
 
                // ViewEdge
                // qi --
@@ -1559,11 +1559,11 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, real epsilo
                // occluders --
                for (set<ViewShape*>::iterator o = occluders.begin(), oend = occluders.end(); o != oend; ++o)
                        (*ve)->AddOccluder((*o));
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "\tConclusion: QI = " << maxIndex << ", " << (*ve)->occluders_size() << " occluders." << endl;
-                       }
-               #endif
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "\tConclusion: QI = " << maxIndex << ", " << (*ve)->occluders_size() << " occluders." << endl;
+               }
+#endif
                // occludee --
                if (!aFaces.empty()) {
                        if (aFaces.size() <= (float)nSamples / 2.0f) {
@@ -1571,7 +1571,7 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, real epsilo
                        }
                        else {
                                vector<Polygon3r*>::iterator p = aFaces.begin();
-                               WFace *wface = (WFace*)((*p)->userdata);
+                               WFace *wface = (WFace *)((*p)->userdata);
                                ViewShape *vshape = ioViewMap->viewShape(wface->GetVertex(0)->shape()->GetId());
                                ++p;
                                (*ve)->setaShape(vshape);
@@ -1686,7 +1686,7 @@ void ViewMapBuilder::ComputeFastRayCastingVisibility(ViewMap *ioViewMap, real ep
                        }
                        else {
                                vector<Polygon3r*>::iterator p = aFaces.begin();
-                               WFace *wface = (WFace*)((*p)->userdata);
+                               WFace *wface = (WFace *)((*p)->userdata);
                                ViewShape *vshape = ioViewMap->viewShape(wface->GetVertex(0)->shape()->GetId());
                                ++p;
 #if 0
@@ -1750,7 +1750,7 @@ void ViewMapBuilder::ComputeVeryFastRayCastingVisibility(ViewMap *ioViewMap, rea
                qi = ComputeRayCastingVisibility(fe, _Grid, epsilon, occluders, &aFace, timestamp++);
                if (aFace) {
                        fe->setaFace(*aFace);
-                       WFace *wface = (WFace*)(aFace->userdata);
+                       WFace *wface = (WFace *)(aFace->userdata);
                        ViewShape *vshape = ioViewMap->viewShape(wface->GetVertex(0)->shape()->GetId());
                        (*ve)->setaShape(vshape);
                }
@@ -1776,7 +1776,7 @@ void ViewMapBuilder::FindOccludee(FEdge *fe, Grid *iGrid, real epsilon, Polygon3
        WFace *face = NULL;
        if (fe->isSmooth()) {
                FEdgeSmooth *fes = dynamic_cast<FEdgeSmooth*>(fe);
-               face = (WFace*)fes->face();
+               face = (WFace *)fes->face();
        }
        OccludersSet occluders;
        WFace *oface;
@@ -1799,7 +1799,7 @@ void ViewMapBuilder::FindOccludee(FEdge *fe, Grid *iGrid, real epsilon, Polygon3
                        // check whether the edge and the polygon plane are coincident:
                        //-------------------------------------------------------------
                        //first let us compute the plane equation.
-                       oface = (WFace*)(*p)->userdata;
+                       oface = (WFace *)(*p)->userdata;
                        Vec3r v1(((*p)->getVertices())[0]);
                        Vec3r normal((*p)->getNormal());
                        real d = -(v1 * normal);
@@ -1880,15 +1880,15 @@ void ViewMapBuilder::FindOccludee(FEdge *fe, Grid *iGrid, real epsilon, Polygon3
        }
        u.normalize();
        if (A < iGrid->getOrigin())
-               cerr << "Warning: point is out of the grid for fedge " << fe->getId().getFirst() << "-"
-                    << fe->getId().getSecond() << endl;
+               cerr << "Warning: point is out of the grid for fedge " << fe->getId().getFirst() << "-" <<
+                       fe->getId().getSecond() << endl;
 
        vector<WVertex*> faceVertices;
 
        WFace *face = NULL;
        if (fe->isSmooth()) {
                FEdgeSmooth *fes = dynamic_cast<FEdgeSmooth*>(fe);
-               face = (WFace*)fes->face();
+               face = (WFace *)fes->face();
        }
        if (face)
                face->RetrieveVertexList(faceVertices);
@@ -1914,7 +1914,8 @@ int ViewMapBuilder::ComputeRayCastingVisibility(FEdge *fe, Grid *iGrid, real eps
        Vec3r gridExtremity(iGrid->getOrigin() + iGrid->gridSize());
 
        if ((center.x() < gridOrigin.x()) || (center.y() < gridOrigin.y()) || (center.z() < gridOrigin.z()) ||
-           (center.x() > gridExtremity.x()) || (center.y() > gridExtremity.y()) || (center.z() > gridExtremity.z())) {
+           (center.x() > gridExtremity.x()) || (center.y() > gridExtremity.y()) || (center.z() > gridExtremity.z()))
+       {
                cerr << "Warning: point is out of the grid for fedge " << fe->getId() << endl;
                //return 0;
        }
@@ -1953,10 +1954,10 @@ int ViewMapBuilder::ComputeRayCastingVisibility(FEdge *fe, Grid *iGrid, real eps
 
        WFace *face = NULL;
        if (fe->isSmooth()) {
-               FEdgeSmooth *fes = dynamic_cast<FEdgeSmooth*>(fe);
-               face = (WFace*)fes->face();
+               FEdgeSmooth *fes = dynamic_cast<FEdgeSmooth *>(fe);
+               face = (WFace *)fes->face();
        }
-       vector<WVertex*> faceVertices;
+       vector<WVertex *> faceVertices;
        WVertex::incoming_edge_iterator ie;
 
        WFace *oface;
@@ -1969,40 +1970,40 @@ int ViewMapBuilder::ComputeRayCastingVisibility(FEdge *fe, Grid *iGrid, real eps
                // If we're dealing with an exact silhouette, check whether we must take care of this occluder of not.
                // (Indeed, we don't consider the occluders that share at least one vertex with the face containing this edge).
                //-----------
-               oface = (WFace*)(*p)->userdata;
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "\t\tEvaluating intersection for occluder " << ((*p)->getVertices())[0] << ((*p)->getVertices())[1]
-                                    << ((*p)->getVertices())[2] << endl << "\t\t\tand ray " << vp << " * " << u << " (center " << center
-                                    << ")" << endl;
-                       }
-               #endif
+               oface = (WFace *)(*p)->userdata;
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "\t\tEvaluating intersection for occluder " << ((*p)->getVertices())[0] <<
+                               ((*p)->getVertices())[1] << ((*p)->getVertices())[2] << endl << "\t\t\tand ray " << vp <<
+                               " * " << u << " (center " << center << ")" << endl;
+               }
+#endif
                Vec3r v1(((*p)->getVertices())[0]);
                Vec3r normal((*p)->getNormal());
                real d = -(v1 * normal);
                real t, t_u, t_v;
 
-               #if LOGGING
-                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                               cout << "\t\tp:  " << ((*p)->getVertices())[0] << ((*p)->getVertices())[1] << ((*p)->getVertices())[2]
-                                    << ", norm: " << (*p)->getNormal() << endl;
-                       }
-               #endif
+#if LOGGING
+               if (_global.debug & G_DEBUG_FREESTYLE) {
+                       cout << "\t\tp:  " << ((*p)->getVertices())[0] << ((*p)->getVertices())[1] << ((*p)->getVertices())[2] <<
+                               ", norm: " << (*p)->getNormal() << endl;
+               }
+#endif
 
                if (face) {
-                       #if LOGGING
-                               if (_global.debug & G_DEBUG_FREESTYLE) {
-                                       cout << "\t\tDetermining face adjacency...";
-                               }
-                       #endif
+#if LOGGING
+                       if (_global.debug & G_DEBUG_FREESTYLE) {
+                               cout << "\t\tDetermining face adjacency...";
+                       }
+#endif
                        skipFace = false;
 
                        if (face == oface) {
-                               #if LOGGING
-                                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                                               cout << "  Rejecting occluder for face concurrency." << endl;
-                                       }
-                               #endif
+#if LOGGING
+                               if (_global.debug & G_DEBUG_FREESTYLE) {
+                                       cout << "  Rejecting occluder for face concurrency." << endl;
+                               }
+#endif
                                continue;
                        }
 
@@ -2031,11 +2032,11 @@ int ViewMapBuilder::ComputeRayCastingVisibility(FEdge *fe, Grid *iGrid, real eps
                                        break;
                        }
                        if (skipFace) {
-                               #if LOGGING
-                                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                                               cout << "  Rejecting occluder for face adjacency." << endl;
-                                       }
-                               #endif
+#if LOGGING
+                               if (_global.debug & G_DEBUG_FREESTYLE) {
+                                       cout << "  Rejecting occluder for face adjacency." << endl;
+                               }
+#endif
                                continue;
                        }
                }
@@ -2045,31 +2046,31 @@ int ViewMapBuilder::ComputeRayCastingVisibility(FEdge *fe, Grid *iGrid, real eps
                        //first let us compute the plane equation.
 
                        if (GeomUtils::COINCIDENT == GeomUtils::intersectRayPlane(origin, edge, normal, d, t, epsilon)) {
-                               #if LOGGING
-                                       if (_global.debug & G_DEBUG_FREESTYLE) {
-                                               cout << "\t\tRejecting occluder for target coincidence." << endl;
-                                       }
-                               #endif
+#if LOGGING
+                               if (_global.debug & G_DEBUG_FREESTYLE) {
+                                       cout << "\t\tRejecting occluder for target coincidence." << endl;
+                               }
+#endif
                                continue;
                        }
                }
 
                if ((*p)->rayIntersect(center, u, t, t_u, t_v)) {
-                       #if LOGGING
-                               if (_global.debug & G_DEBUG_FREESTYLE) {
-                                       cout << "\t\tRay " << vp << " * " << u << " intersects at time " << t << " (raylength is "
-                                            << raylength << ")" << endl;
-                                       cout << "\t\t(u * normal) == " << (u * normal) << " for normal " << normal << endl;
-                               }
-                       #endif
+#if LOGGING
+                       if (_global.debug & G_DEBUG_FREESTYLE) {
+                               cout << "\t\tRay " << vp << " * " << u << " intersects at time " << t << " (raylength is " <<
+                                       raylength << ")" << endl;
+                               cout << "\t\t(u * normal) == " << (u * normal) << " for normal " << normal << endl;
+                       }
+#endif
                        if (fabs(u * normal) > 0.0001) {
                                if ((t>0.0) && (t<raylength)) {
-                                       #if LOGGING
-                                               if (_global.debug & G_DEBUG_FREESTYLE) {
-                                                       cout << "\t\tIs occluder" << endl;
-                                               }
-                                       #endif
-                                       WFace *f = (WFace*)((*p)->userdata);
+#if LOGGING
+                                       if (_global.debug & G_DEBUG_FREESTYLE) {
+                                               cout << "\t\tIs occluder" << endl;
+                                       }
+#endif
+                                       WFace *f = (WFace *)((*p)->userdata);
                                        ViewShape *vshape = _ViewMap->viewShape(f->GetVertex(0)->shape()->GetId());
                                        oOccluders.insert(vshape);
                                        ++qi;
@@ -2101,7 +2102,7 @@ void ViewMapBuilder::ComputeIntersections(ViewMap *ioViewMap, intersection_algo
             ++vv)
        {
                if ((*vv)->getNature() == Nature::T_VERTEX) {
-                       TVertex *tvertex = (TVertex*)(*vv);
+                       TVertex *tvertex = (TVertex *)(*vv);
                        if (_global.debug & G_DEBUG_FREESTYLE) {
                                cout << "TVertex " << tvertex->getId() << " has :" << endl;
                                cout << "FrontEdgeA: " << tvertex->frontEdgeA().first << endl;
@@ -2113,11 +2114,11 @@ void ViewMapBuilder::ComputeIntersections(ViewMap *ioViewMap, intersection_algo
        }
 }
 
-struct less_SVertex2D : public binary_function<SVertex*, SVertex*, bool>
+struct less_SVertex2D : public binary_function<SVertex *, SVertex *, bool>
 {
        real epsilon;
 
-       less_SVertex2D(real eps) : binary_function<SVertex*, SVertex*, bool>()
+       less_SVertex2D(real eps) : binary_function<SVertex *, SVertex *, bool>()
        {
                epsilon = eps;
        }
@@ -2138,14 +2139,14 @@ struct less_SVertex2D : public binary_function<SVertex*, SVertex*, bool>
        }
 };
 
-typedef Segment<FEdge*, Vec3r> segment;
+typedef Segment<FEdge *, Vec3r> segment;
 typedef Intersection<segment> intersection;
 
-struct less_Intersection : public binary_function<intersection*, intersection*, bool>
+struct less_Intersection : public binary_function<intersection *, intersection *, bool>
 {
        segment *edge;
 
-       less_Intersection(segment *iEdge) : binary_function<intersection*, intersection*, bool>()
+       less_Intersection(segment *iEdge) : binary_function<intersection *, intersection *, bool>()
        {
                edge = iEdge;
        }
@@ -2162,7 +2163,7 @@ struct less_Intersection : public binary_function<intersection*, intersection*,
 
 struct silhouette_binary_rule : public binary_rule<segment, segment>
 {
-       silhouette_binary_rule() : binary_rule<segment,segment>() {}
+       silhouette_binary_rule() : binary_rule<segment, segment>() {}
 
        virtual bool operator()(segment& s1, segment& s2)
        {
@@ -2181,7 +2182,7 @@ struct silhouette_binary_rule : public binary_rule<segment, segment>
 
 void ViewMapBuilder::ComputeSweepLineIntersections(ViewMap *ioViewMap, real epsilon)
 {
-       vector<SVertex*>& svertices = ioViewMap->SVertices();
+       vector<SVertex *>& svertices = ioViewMap->SVertices();
        bool progressBarDisplay = false;
        unsigned sVerticesSize = svertices.size();
        unsigned fEdgesSize = ioViewMap->FEdges().size();
@@ -2209,9 +2210,9 @@ void ViewMapBuilder::ComputeSweepLineIntersections(ViewMap *ioViewMap, real epsi
 
        sort(svertices.begin(), svertices.end(), less_SVertex2D(epsilon));
 
-       SweepLine<FEdge*, Vec3r> SL;
+       SweepLine<FEdge *, Vec3r> SL;
 
-       vector<FEdge*>& ioEdges = ioViewMap->FEdges();
+       vector<FEdge *>& ioEdges = ioViewMap->FEdges();
 
        vector<segment*> segments;
 
@@ -2230,8 +2231,8 @@ void ViewMapBuilder::ComputeSweepLineIntersections(ViewMap *ioViewMap, real epsi
 
                const vector<FEdge*>& vedges = (*sv)->fedges();
 
-               for (vector<FEdge*>::const_iterator sve = vedges.begin(), sveend = vedges.end(); sve != sveend; sve++) {
-                       vsegments.push_back((segment*)((*sve)->userdata));
+               for (vector<FEdge *>::const_iterator sve = vedges.begin(), sveend = vedges.end(); sve != sveend; sve++) {
+                       vsegments.push_back((segment *)((*sve)->userdata));
                }
 
                Vec3r evt((*sv)->point2D());
@@ -2291,24 +2292,24 @@ void ViewMapBuilder::ComputeSweepLineIntersections(ViewMap *ioViewMap, real epsi
                real ta = (*i)->tA;
                real tb = (*i)->tB;
 
-               if ((ta < -epsilon) || (ta > 1+epsilon))
-                       cerr << "Warning: 2D intersection out of range for edge " << fA->vertexA()->getId() << " - "
-                            << fA->vertexB()->getId() << endl;
+               if ((ta < -epsilon) || (ta > 1 + epsilon))
+                       cerr << "Warning: 2D intersection out of range for edge " << fA->vertexA()->getId() << " - " <<
+                               fA->vertexB()->getId() << endl;
 
-               if ((tb < -epsilon) || (tb > 1+epsilon))
-                       cerr << "Warning: 2D intersection out of range for edge " << fB->vertexA()->getId() << " - "
-                            << fB->vertexB()->getId() << endl;
+               if ((tb < -epsilon) || (tb > 1 + epsilon))
+                       cerr << "Warning: 2D intersection out of range for edge " << fB->vertexA()->getId() << " - " <<
+                               fB->vertexB()->getId() << endl;
 
                real Ta = SilhouetteGeomEngine::ImageToWorldParameter(fA, ta);
                real Tb = SilhouetteGeomEngine::ImageToWorldParameter(fB, tb);
 
                if ((Ta < -epsilon) || (Ta > 1 + epsilon))
-                       cerr << "Warning: 3D intersection out of range for edge " << fA->vertexA()->getId() << " - "
-                            << fA->vertexB()->getId() << endl;
+                       cerr << "Warning: 3D intersection out of range for edge " << fA->vertexA()->getId() << " - " <<
+                               fA->vertexB()->getId() << endl;
 
                if ((Tb < -epsilon) || (Tb > 1 + epsilon))
-                       cerr << "Warning: 3D intersection out of range for edge " << fB->vertexA()->getId() << " - "
-                            << fB->vertexB()->getId() << endl;
+                       cerr << "Warning: 3D intersection out of range for edge " << fB->vertexA()->getId() << " - " <<
+                               fB->vertexB()->getId() << endl;
 
 #if 0
                if (G.debug & G_DEBUG_FREESTYLE) {
@@ -2364,7 +2365,7 @@ void ViewMapBuilder::ComputeSweepLineIntersections(ViewMap *ioViewMap, real epsi
                // we first need to sort these intersections from farther to closer to A
                sort(eIntersections.begin(), eIntersections.end(), less_Intersection(*s));
                for (i = eIntersections.begin(), iend = eIntersections.end(); i != iend; i++)
-                       edgeVVertices.push_back((TVertex*)(*i)->userdata);
+                       edgeVVertices.push_back((TVertex *)(*i)->userdata);
 
                shape->SplitEdge(fedge, edgeVVertices, ioViewMap->FEdges(), ioViewMap->ViewEdges());
 
index 0e0e02dcaee109da98ac55b6c648cd2b2905ae46..33daf5a7886005085dcc69188b0699ab3584950b 100644 (file)
@@ -63,7 +63,7 @@ namespace ViewMapIO {
 
 namespace Internal {
 
-ViewMapg_vm;
+ViewMap *g_vm;
 
 //////////////////// 'load' Functions ////////////////////
 
@@ -1073,7 +1073,7 @@ int load(istream& in, ViewMap *vm, ProgressBar *pb)
        // Read the shape id to index mapping
        unsigned map_s;
        READ(map_s);
-       unsigned id,index;
+       unsigned id, index;
        for (unsigned int i4 = 0; i4 < map_s; ++i4) {
                READ(id);
                READ(index);
index 44521f03317161753c6542dbbc02e6cc5342acb6..6a7268a71a93f5c2008c2d0f094d465d1a7e834e 100644 (file)
@@ -96,7 +96,7 @@ ostream& write<1>(ostream& out, const char *str)
 }
 
 template<>
-ostream& write<0>(ostream& out, const char*)
+ostream& write<0>(ostream& out, const char *)
 {
        return out;
 }
@@ -115,7 +115,7 @@ istream& read<1>(istream& in, char *str)
 }
 
 template<>
-istream& read<0>(istream& in, char*)
+istream& read<0>(istream& in, char *)
 {
        return in;
 }
index 64b897c5596062c0bc9ffa7224f9c2875db0e68b..5cf45a2a93422ccd857bd14fbabacb546a94f0e3 100644 (file)
@@ -64,8 +64,8 @@ static bool angle_obtuse(WVertex *v, WFace *f)
        WOEdge *e;
        f->getOppositeEdge(v, e);
 
-       Vec3r vec1(e->GetaVertex()->GetVertex()-v->GetVertex());
-       Vec3r vec2(e->GetbVertex()->GetVertex()-v->GetVertex());
+       Vec3r vec1(e->GetaVertex()->GetVertex() - v->GetVertex());
+       Vec3r vec2(e->GetbVertex()->GetVertex() - v->GetVertex());
        return ((vec1 * vec2) < 0);
 }
 
@@ -147,12 +147,12 @@ bool gts_vertex_mean_curvature_normal(WVertex *v, Vec3r &Kh)
 
        WVertex::incoming_edge_iterator itE;
 
-       for (itE=v->incoming_edges_begin(); itE != v->incoming_edges_end(); itE++)
+       for (itE = v->incoming_edges_begin(); itE != v->incoming_edges_end(); itE++)
                area += (*itE)->GetaFace()->getArea();
 
        Kh = Vec3r(0.0, 0.0, 0.0);
 
-       for (itE=v->incoming_edges_begin(); itE != v->incoming_edges_end(); itE++) {
+       for (itE = v->incoming_edges_begin(); itE != v->incoming_edges_end(); itE++) {
                WOEdge *e = (*itE)->getPrevOnFace();
 #if 0
                if ((e->GetaVertex() == v) || (e->GetbVertex() == v))
@@ -348,12 +348,12 @@ void gts_vertex_principal_directions(WVertex *v, Vec3r Kh, real Kg, Vec3r &e1, V
 
        aterm_da = bterm_da = cterm_da = const_da = 0.0;
        aterm_db = bterm_db = cterm_db = const_db = 0.0;
-       int nb_edges=v->GetEdges().size();
+       int nb_edges = v->GetEdges().size();
 
-       weights = (real *)malloc(sizeof (real) * nb_edges);
-       kappas = (real *)malloc(sizeof (real) * nb_edges);
-       d1s = (real *)malloc(sizeof (real) * nb_edges);
-       d2s = (real *)malloc(sizeof (real) * nb_edges);
+       weights = (real *)malloc(sizeof(real) * nb_edges);
+       kappas = (real *)malloc(sizeof(real) * nb_edges);
+       d1s = (real *)malloc(sizeof(real) * nb_edges);
+       d2s = (real *)malloc(sizeof(real) * nb_edges);
        edge_count = 0;
 
        for (itE = v->incoming_edges_begin(); itE != v->incoming_edges_end(); itE++) {
index 6201d23f9bf79f9d23a618e2b4a7b5a7d7fa0793..b3ac888361b13eca54abc2842578b4b759a37d17 100644 (file)
@@ -314,7 +314,7 @@ WOEdge *WFace::MakeEdge(WVertex *v1, WVertex *v2)
                        // Adds the edge to the face
                        //AddEdge((*it1)->GetaOEdge());
                        AddEdge(woea);
-                       (*it1)->setNumberOfOEdges((*it1)->GetNumberOfOEdges()+1);
+                       (*it1)->setNumberOfOEdges((*it1)->GetNumberOfOEdges() + 1);
                        //sets these vertices as border:
                        v1->setBorder(true);
                        v2->setBorder(true);
@@ -330,7 +330,7 @@ WOEdge *WFace::MakeEdge(WVertex *v1, WVertex *v2)
                        // Adds the edge to the face
                        //AddEdge((*it1)->GetaOEdge());
                        AddEdge(woeb);
-                       (*it1)->setNumberOfOEdges((*it1)->GetNumberOfOEdges()+1);
+                       (*it1)->setNumberOfOEdges((*it1)->GetNumberOfOEdges() + 1);
                        //sets these vertices as border:
                        v1->setBorder(true);
                        v2->setBorder(true);
@@ -402,7 +402,7 @@ WOEdge *WFace::MakeEdge(WVertex *v1, WVertex *v2)
 }
 
 
-bool WFace::getOppositeEdge (const WVertex *v, WOEdge *&e)
+bool WFace::getOppositeEdge(const WVertex *v, WOEdge *&e)
 {
        if (_OEdgeList.size() != 3)
                return false;
@@ -441,7 +441,7 @@ real WFace::getArea ()
 }
 
 
-WOEdge *WFace::GetPrevOEdge(WOEdgeiOEdge)
+WOEdge *WFace::GetPrevOEdge(WOEdge *iOEdge)
 {
        vector<WOEdge *>::iterator woe, woend, woefirst;
        woefirst = _OEdgeList.begin();
@@ -645,7 +645,8 @@ WFace *WShape::MakeFace(vector<WVertex *>& iVertexList, vector<bool>& iFaceEdgeM
        if (3 == iVertexList.size()) {
                if ((iVertexList[0] == iVertexList[1]) ||
                    (iVertexList[0] == iVertexList[2]) ||
-                   (iVertexList[2] == iVertexList[1])) {
+                   (iVertexList[2] == iVertexList[1]))
+               {
                        cerr << "Warning: degenerated triangle detected, correcting" << endl;
                        return NULL;
                }
index be9181329d6dd3b06a126f64043afca6bba38712..1646d995a221999d8e6026c3ca22c5f47495d2b4 100644 (file)
@@ -235,7 +235,7 @@ public:
 
                virtual bool operator==(const incoming_edge_iterator& b) const
                {
-                       return ((_current)== (b._current));
+                       return ((_current) == (b._current));
                }
 
                // dereferencing
@@ -311,7 +311,7 @@ public:
 
                virtual bool operator==(const face_iterator& b) const
                {
-                       return ((_edge_it)== (b._edge_it));
+                       return ((_edge_it) == (b._edge_it));
                }
 
                // dereferencing
@@ -973,7 +973,7 @@ public:
        /*! For triangles, returns the edge opposite to the vertex in e.
         *  returns flase if the face is not a triangle or if the vertex is not found
         */
-       bool getOppositeEdge (const WVertex *v, WOEdge&e);
+       bool getOppositeEdge (const WVertex *v, WOEdge *&e);
 
        /*! compute the area of the face */
        real getArea ();
index 719ed10925df2e9abce321fef9071780c9d23d88..6190318e4159ab760f21d98ff0240771be102ce0 100644 (file)
@@ -59,7 +59,7 @@ unsigned int WXFaceLayer::GetSmoothEdgeIndex() const
        int i = 0;
        int nEdges = _pWXFace->numberOfEdges();
        for (i = 0; i < nEdges; ++i) {
-               if ((_DotP[i] == 0) && (_DotP[(i+1)%nEdges] == 0)) {
+               if ((_DotP[i] == 0) && (_DotP[(i + 1) % nEdges] == 0)) {
                        return i;
                }
        }
index 9f3522e4e70caea1c9b1fb3dc5bdd347b60f20f9..cb111dd516ca49f4f4dc0930d02602e735193276 100644 (file)
@@ -765,13 +765,13 @@ public:
                // Reset Edges
                vector<WEdge *>& wedges = getEdgeList();
                for (vector<WEdge *>::iterator we = wedges.begin(), weend = wedges.end(); we != weend; ++we) {
-                       ((WXEdge*)(*we))->Reset();
+                       ((WXEdge *)(*we))->Reset();
                }
 
                //Reset faces:
                vector<WFace *>& wfaces = GetFaceList();
                for (vector<WFace *>::iterator wf = wfaces.begin(), wfend = wfaces.end(); wf != wfend; ++wf) {
-                       ((WXFace*)(*wf))->Reset();
+                       ((WXFace *)(*wf))->Reset();
                }
        }
        /*! accessors */
index 51e93f34fa3cf229b57d1857988c95abd3130961..772a88a05af752cedd6da8e27ec36dca1aec8a6d 100644 (file)
@@ -25,7 +25,7 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/freestyle/intern/winged_edge/WSBuilder.cpp
+/** \file blender/freestyle/intern/winged_edge/WXEdgeBuilder.cpp
  *  \ingroup freestyle
  *  \brief Class inherited from WingedEdgeBuilder and designed to build a WX (WingedEdge + extended info
  *         (silhouette etc...)) structure from a polygonal model
index 91e9b389f7c2aa8f5dc6d3ef204ef7167b2ddba5..690126c533eac56b0d89a485d79581b5d8f10947 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef __FREESTYLE_WX_EDGE_BUILDER_H__
 #define __FREESTYLE_WX_EDGE_BUILDER_H__
 
-/** \file blender/freestyle/intern/winged_edge/WSBuilder.h
+/** \file blender/freestyle/intern/winged_edge/WXEdgeBuilder.h
  *  \ingroup freestyle
  *  \brief Class inherited from WingedEdgeBuilder and designed to build a WX (WingedEdge + extended info
  *         (silhouette etc...)) structure from a polygonal model
index 4ef34bbe3eee88e01fc65ee24263d9f246168b3a..c1a93f70a7ebbbb30f775c28e3cf9635ed2fb7c8 100644 (file)
@@ -199,7 +199,7 @@ void WingedEdgeBuilder::buildWShape(WShape& shape, IndexedFaceSet& ifs)
                                break;
                        }
                }
-               if (normalsSet.size() !=) {
+               if (normalsSet.size() != 1) {
                        (*wv)->setSmooth(false);
                }
        }