From 7426a3e35bb6ebc5c08eb307c0f9d30ef51ae570 Mon Sep 17 00:00:00 2001 From: Maxime Curioni Date: Mon, 21 Jul 2008 21:24:37 +0000 Subject: Added StrokeAttribute class. Beginning of StrokeVertex. IMPORTANT: The setters functions' names were normalized due to constant confusion regarding capitalization. All the function names start with set... instead of Set.... This convention was changed all throughout Freestyle. To use Freestyle as an external renderer, the SWIG library MUST be regenerated. --- .../freestyle/intern/view_map/FEdgeXDetector.cpp | 10 +- .../freestyle/intern/view_map/FEdgeXDetector.h | 4 +- .../blender/freestyle/intern/view_map/Silhouette.h | 130 ++++++++++----------- .../intern/view_map/SilhouetteGeomEngine.cpp | 10 +- .../intern/view_map/SilhouetteGeomEngine.h | 6 +- .../freestyle/intern/view_map/ViewEdgeXBuilder.cpp | 74 ++++++------ .../freestyle/intern/view_map/ViewEdgeXBuilder.h | 6 +- .../blender/freestyle/intern/view_map/ViewMap.cpp | 46 ++++---- source/blender/freestyle/intern/view_map/ViewMap.h | 106 ++++++++--------- .../freestyle/intern/view_map/ViewMapBuilder.cpp | 42 +++---- .../freestyle/intern/view_map/ViewMapBuilder.h | 16 +-- .../freestyle/intern/view_map/ViewMapIO.cpp | 102 ++++++++-------- .../freestyle/intern/view_map/ViewMapTesselator.h | 18 +-- 13 files changed, 285 insertions(+), 285 deletions(-) (limited to 'source/blender/freestyle/intern/view_map') diff --git a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp index d9caee85e18..54a982b8bd8 100755 --- a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp +++ b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp @@ -132,11 +132,11 @@ void FEdgeXDetector::preProcessFace(WXFace *iFace){ Vec3r V(_Viewpoint - firstPoint); N.normalize(); V.normalize(); - iFace->SetDotP(N * V); + iFace->setDotP(N * V); // compute the distance between the face center and the viewpoint: Vec3r dist_vec(iFace->center() - _Viewpoint); - iFace->SetZ(dist_vec.norm()); + iFace->setZ(dist_vec.norm()); } void FEdgeXDetector::computeCurvatures(WXVertex *vertex){ @@ -257,7 +257,7 @@ void FEdgeXDetector::ProcessSilhouetteFace(WXFace *iFace) } } // Set the closest point id: - faceLayer->SetClosestPointIndex(closestPointId); + faceLayer->setClosestPointIndex(closestPointId); // Add this layer to the face: iFace->AddSmoothLayer(faceLayer); } @@ -281,9 +281,9 @@ void FEdgeXDetector::ProcessSilhouetteEdge(WXEdge *iEdge) return; iEdge->AddNature(Nature::SILHOUETTE); if(fB->front()) - iEdge->SetOrder(1); + iEdge->setOrder(1); else - iEdge->SetOrder(-1); + iEdge->setOrder(-1); } } diff --git a/source/blender/freestyle/intern/view_map/FEdgeXDetector.h b/source/blender/freestyle/intern/view_map/FEdgeXDetector.h index a6235dd53b5..5e6788c6ff8 100755 --- a/source/blender/freestyle/intern/view_map/FEdgeXDetector.h +++ b/source/blender/freestyle/intern/view_map/FEdgeXDetector.h @@ -106,7 +106,7 @@ public: virtual void buildSmoothEdges(WXShape* iShape); /*! Sets the current viewpoint */ - inline void SetViewpoint(const Vec3r& ivp) {_Viewpoint = ivp;} + inline void setViewpoint(const Vec3r& ivp) {_Viewpoint = ivp;} inline void enableRidgesAndValleysFlag(bool b) {_computeRidgesAndValleys = b;} inline void enableSuggestiveContours(bool b) {_computeSuggestiveContours = b;} /*! Sets the radius of the geodesic sphere around each vertex (for the curvature computation) @@ -120,7 +120,7 @@ public: } } - inline void SetProgressBar(ProgressBar *iProgressBar) {_pProgressBar = iProgressBar;} + inline void setProgressBar(ProgressBar *iProgressBar) {_pProgressBar = iProgressBar;} protected: diff --git a/source/blender/freestyle/intern/view_map/Silhouette.h b/source/blender/freestyle/intern/view_map/Silhouette.h index 15947fe3ba4..c88a3da8967 100755 --- a/source/blender/freestyle/intern/view_map/Silhouette.h +++ b/source/blender/freestyle/intern/view_map/Silhouette.h @@ -240,9 +240,9 @@ public: /*! modifiers */ /*! Sets the 3D coordinates of the SVertex. */ - inline void SetPoint3D(const Vec3r &iPoint3D) {_Point3D = iPoint3D;} + inline void setPoint3D(const Vec3r &iPoint3D) {_Point3D = iPoint3D;} /*! Sets the 3D projected coordinates of the SVertex. */ - inline void SetPoint2D(const Vec3r &iPoint2D) {_Point2D = iPoint2D;} + inline void setPoint2D(const Vec3r &iPoint2D) {_Point2D = iPoint2D;} /*! Adds a normal to the Svertex's set of normals. If the same * normal is already in the set, nothing changes. */ @@ -266,10 +266,10 @@ public: const Vec2r directionFredo () {return _directionFredo;} /*! Sets the Id */ - inline void SetId(const Id& id) {_Id = id;} - inline void SetFEdges(const vector& iFEdges) {_FEdges = iFEdges;} - inline void SetShape(SShape *iShape) {_Shape = iShape;} - inline void SetViewVertex(ViewVertex *iViewVertex) {_pViewVertex = iViewVertex;} + inline void setId(const Id& id) {_Id = id;} + inline void setFEdges(const vector& iFEdges) {_FEdges = iFEdges;} + inline void setShape(SShape *iShape) {_Shape = iShape;} + inline void setViewVertex(ViewVertex *iViewVertex) {_pViewVertex = iViewVertex;} /*! Add an FEdge to the list of edges emanating from this SVertex. */ inline void AddFEdge(FEdge* iFEdge) {_FEdges.push_back(iFEdge);} /* replaces edge 1 by edge 2 in the list of edges */ @@ -501,30 +501,30 @@ public: /* modifiers */ /*! Sets the first SVertex. */ - inline void SetVertexA(SVertex *vA) {_VertexA = vA;} + inline void setVertexA(SVertex *vA) {_VertexA = vA;} /*! Sets the second SVertex. */ - inline void SetVertexB(SVertex *vB) {_VertexB = vB;} + inline void setVertexB(SVertex *vB) {_VertexB = vB;} /*! Sets the FEdge Id . */ - inline void SetId(const Id& id) {_Id = id;} + inline void setId(const Id& id) {_Id = id;} /*! Sets the pointer to the next FEdge. */ - inline void SetNextEdge(FEdge* iEdge) {_NextEdge = iEdge;} + inline void setNextEdge(FEdge* iEdge) {_NextEdge = iEdge;} /*! Sets the pointer to the previous FEdge. */ - inline void SetPreviousEdge(FEdge *iEdge) {_PreviousEdge = iEdge;} + inline void setPreviousEdge(FEdge *iEdge) {_PreviousEdge = iEdge;} /*! Sets the nature of this FEdge. */ - inline void SetNature(Nature::EdgeNature iNature) {_Nature = iNature;} + inline void setNature(Nature::EdgeNature iNature) {_Nature = iNature;} //inline void AddOccluder(Polygon3r& iPolygon) {_Occluders.push_back(iPolygon);} /*! Sets the ViewEdge to which this FEdge belongs to. */ - inline void SetViewEdge(ViewEdge *iViewEdge) {_ViewEdge = iViewEdge;} - // inline void SetHasVisibilityPoint(bool iBool) {_hasVisibilityPoint = iBool;} - // inline void SetVisibilityPointA(const Vec3r& iPoint) {_VisibilityPointA = iPoint;} - // inline void SetVisibilityPointB(const Vec3r& iPoint) {_VisibilityPointB = iPoint;} - inline void SetaFace(Polygon3r& iFace) {_aFace = iFace;} - inline void SetOccludeeIntersection(const Vec3r& iPoint) {_occludeeIntersection = iPoint;} - inline void SetOccludeeEmpty(bool iempty) {_occludeeEmpty = iempty;} + inline void setViewEdge(ViewEdge *iViewEdge) {_ViewEdge = iViewEdge;} + // inline void setHasVisibilityPoint(bool iBool) {_hasVisibilityPoint = iBool;} + // inline void setVisibilityPointA(const Vec3r& iPoint) {_VisibilityPointA = iPoint;} + // inline void setVisibilityPointB(const Vec3r& iPoint) {_VisibilityPointB = iPoint;} + inline void setaFace(Polygon3r& iFace) {_aFace = iFace;} + inline void setOccludeeIntersection(const Vec3r& iPoint) {_occludeeIntersection = iPoint;} + inline void setOccludeeEmpty(bool iempty) {_occludeeEmpty = iempty;} /*! Sets the flag telling whether this FEdge is smooth or sharp. * true for Smooth, false for Sharp. */ - inline void SetSmooth(bool iFlag) {_isSmooth = iFlag;} + inline void setSmooth(bool iFlag) {_isSmooth = iFlag;} /* checks whether two FEdge have a common vertex. * Returns a pointer on the common vertex if it exists, @@ -840,13 +840,13 @@ public: const Material& bMaterial() const ; /*! Sets the normal to the face lying on the right of the FEdge. */ - inline void SetNormalA(const Vec3r& iNormal) {_aNormal = iNormal;} + inline void setNormalA(const Vec3r& iNormal) {_aNormal = iNormal;} /*! Sets the normal to the face lying on the left of the FEdge. */ - inline void SetNormalB(const Vec3r& iNormal) {_bNormal = iNormal;} + inline void setNormalB(const Vec3r& iNormal) {_bNormal = iNormal;} /*! Sets the index of the material lying on the right of the FEdge.*/ - inline void SetaMaterialIndex(unsigned i) {_aMaterialIndex = i;} + inline void setaMaterialIndex(unsigned i) {_aMaterialIndex = i;} /*! Sets the index of the material lying on the left of the FEdge.*/ - inline void SetbMaterialIndex(unsigned i) {_bMaterialIndex = i;} + inline void setbMaterialIndex(unsigned i) {_bMaterialIndex = i;} }; @@ -901,11 +901,11 @@ public: /*! Returns the material of the face it is running accross. */ const Material& material() const ; - inline void SetFace(void * iFace) {_Face = iFace;} + inline void setFace(void * iFace) {_Face = iFace;} /*! Sets the normal to the Face it is running accross. */ - inline void SetNormal(const Vec3r& iNormal) {_Normal = iNormal;} + inline void setNormal(const Vec3r& iNormal) {_Normal = iNormal;} /*! Sets the index of the material of the face it is running accross. */ - inline void SetMaterialIndex(unsigned i) {_MaterialIndex = i;} + inline void setMaterialIndex(unsigned i) {_MaterialIndex = i;} }; /**********************************/ /* */ @@ -969,7 +969,7 @@ public: sv++) { SVertex *newv = new SVertex(*(*sv)); - newv->SetShape(this); + newv->setShape(this); _verticesList.push_back(newv); } @@ -1015,7 +1015,7 @@ public: FEdge *current = *fed; newfedgelist.push_back((FEdge*)current->userdata); } - (*sv)->SetFEdges(newfedgelist); + (*sv)->setFEdges(newfedgelist); } //------------------------------------- @@ -1025,10 +1025,10 @@ public: 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)); } @@ -1104,7 +1104,7 @@ public: /*! Adds a SVertex to the list of SVertex of this Shape. * The SShape attribute of the SVertex is also set to 'this'. */ - inline void AddNewVertex(SVertex* iv) {iv->SetShape(this);_verticesList.push_back(iv);} + inline void AddNewVertex(SVertex* iv) {iv->setShape(this);_verticesList.push_back(iv);} inline void AddChain(FEdge *iEdge){ _chains.push_back(iEdge); } @@ -1112,7 +1112,7 @@ public: inline SVertex * CreateSVertex(const Vec3r& P3D, const Vec3r& P2D, const Id& id) { SVertex *Ia = new SVertex(P3D, id); - Ia->SetPoint2D(P2D); + Ia->setPoint2D(P2D); AddNewVertex(Ia); return Ia; } @@ -1172,7 +1172,7 @@ public: // create new SVertex: // (we keep B's id) SVertex* newVertex = new SVertex(newpoint3d, ioB->getId()); - newVertex->SetPoint2D(newpoint2d); + newVertex->setPoint2D(newpoint2d); // Add this vertex to the intersections list: intersections.push_back(newVertex); @@ -1192,23 +1192,23 @@ public: // AB becomes (address speaking) AA'. B is updated. //-------------------------------------------------- // The edge AB becomes edge AA'. - (fe)->SetVertexB((*sv)); + (fe)->setVertexB((*sv)); // a new edge, A'B is created. FEdge *newEdge; if(fe->isSmooth()){ newEdge = new FEdgeSmooth((*sv), svB); FEdgeSmooth * se = dynamic_cast(newEdge); FEdgeSmooth * fes = dynamic_cast(fe); - se->SetMaterialIndex(fes->materialIndex()); + se->setMaterialIndex(fes->materialIndex()); }else{ newEdge = new FEdgeSharp((*sv), svB); FEdgeSharp * se = dynamic_cast(newEdge); FEdgeSharp * fes = dynamic_cast(fe); - se->SetaMaterialIndex(fes->aMaterialIndex()); - se->SetbMaterialIndex(fes->bMaterialIndex()); + se->setaMaterialIndex(fes->aMaterialIndex()); + se->setbMaterialIndex(fes->bMaterialIndex()); } - newEdge->SetNature((fe)->getNature()); + newEdge->setNature((fe)->getNature()); // to build a new chain: @@ -1219,15 +1219,15 @@ public: ioNewEdges.push_back(newEdge); // update edge A'B for the next pointing edge - newEdge->SetNextEdge((fe)->nextEdge()); - fe->nextEdge()->SetPreviousEdge(newEdge); + newEdge->setNextEdge((fe)->nextEdge()); + fe->nextEdge()->setPreviousEdge(newEdge); Id id(fe->getId().getFirst(), fe->getId().getSecond()+1); - newEdge->SetId(fe->getId()); - fe->SetId(id); + newEdge->setId(fe->getId()); + fe->setId(id); // update edge AA' for the next pointing edge - //ioEdge->SetNextEdge(newEdge); - (fe)->SetNextEdge(NULL); + //ioEdge->setNextEdge(newEdge); + (fe)->setNextEdge(NULL); // update vertex pointing edges list: // -- vertex B -- @@ -1264,30 +1264,30 @@ public: newEdge = new FEdgeSmooth(ioNewVertex, B); FEdgeSmooth * se = dynamic_cast(newEdge); FEdgeSmooth * fes = dynamic_cast(ioEdge); - se->SetMaterialIndex(fes->materialIndex()); + se->setMaterialIndex(fes->materialIndex()); }else{ newEdge = new FEdgeSharp(ioNewVertex, B); FEdgeSharp * se = dynamic_cast(newEdge); FEdgeSharp * fes = dynamic_cast(ioEdge); - se->SetaMaterialIndex(fes->aMaterialIndex()); - se->SetbMaterialIndex(fes->bMaterialIndex()); + se->setaMaterialIndex(fes->aMaterialIndex()); + se->setbMaterialIndex(fes->bMaterialIndex()); } - newEdge->SetNature(ioEdge->getNature()); + newEdge->setNature(ioEdge->getNature()); if(ioEdge->nextEdge() != 0) - ioEdge->nextEdge()->SetPreviousEdge(newEdge); + ioEdge->nextEdge()->setPreviousEdge(newEdge); // update edge A'B for the next pointing edge - newEdge->SetNextEdge(ioEdge->nextEdge()); + newEdge->setNextEdge(ioEdge->nextEdge()); // update edge A'B for the previous pointing edge - newEdge->SetPreviousEdge(0); // because it is now a TVertex + newEdge->setPreviousEdge(0); // because it is now a TVertex Id id(ioEdge->getId().getFirst(), ioEdge->getId().getSecond()+1); - newEdge->SetId(ioEdge->getId()); - ioEdge->SetId(id); + newEdge->setId(ioEdge->getId()); + ioEdge->setId(id); // update edge AA' for the next pointing edge - ioEdge->SetNextEdge(0); // because it is now a TVertex + ioEdge->setNextEdge(0); // because it is now a TVertex // update vertex pointing edges list: // -- vertex B -- @@ -1301,17 +1301,17 @@ public: AddEdge(newEdge); // FIXME ?? // The edge AB becomes edge AA'. - ioEdge->SetVertexB(ioNewVertex); + ioEdge->setVertexB(ioNewVertex); if(ioEdge->isSmooth()){ - ((FEdgeSmooth*)newEdge)->SetFace(((FEdgeSmooth*)ioEdge)->face()); + ((FEdgeSmooth*)newEdge)->setFace(((FEdgeSmooth*)ioEdge)->face()); } return newEdge; } /*! Sets the Bounding Box of the Shape */ - inline void SetBBox(const BBox& iBBox) {_BBox = iBBox;} + inline void setBBox(const BBox& iBBox) {_BBox = iBBox;} /*! Compute the bbox of the sshape */ inline void ComputeBBox() @@ -1359,7 +1359,7 @@ public: } - SetBBox(BBox(Vec3r(XMin, YMin, ZMin), Vec3r(XMax, YMax, ZMax))); + setBBox(BBox(Vec3r(XMin, YMin, ZMin), Vec3r(XMax, YMax, ZMax))); } inline void RemoveEdgeFromChain(FEdge *iEdge) @@ -1409,11 +1409,11 @@ public: /* Modififers */ /*! Sets the Id of the shape.*/ - inline void SetId(Id id) {_Id = id;} + inline void setId(Id id) {_Id = id;} /*! Sets the list of materials for the shape */ - inline void SetMaterials(const vector& iMaterials) {_Materials = iMaterials;} - inline void SetViewShape(ViewShape *iShape) {_ViewShape = iShape;} - inline void SetImportance(float importance){_importance = importance;} + inline void setMaterials(const vector& iMaterials) {_Materials = iMaterials;} + inline void setViewShape(ViewShape *iShape) {_ViewShape = iShape;} + inline void setImportance(float importance){_importance = importance;} }; #endif // SILHOUETTE_H diff --git a/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp b/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp index 19b8a632ffe..33c1115e94f 100755 --- a/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp +++ b/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp @@ -55,7 +55,7 @@ real SilhouetteGeomEngine::_zfar = 100.0; SilhouetteGeomEngine * SilhouetteGeomEngine::_pInstance = 0; -void SilhouetteGeomEngine::SetTransform(const real iModelViewMatrix[4][4], const real iProjectionMatrix[4][4], const int iViewport[4], real iFocal) +void SilhouetteGeomEngine::setTransform(const real iModelViewMatrix[4][4], const real iProjectionMatrix[4][4], const int iViewport[4], real iFocal) { unsigned int i,j; _translation[0] = iModelViewMatrix[3][0]; @@ -93,7 +93,7 @@ void SilhouetteGeomEngine::SetTransform(const real iModelViewMatrix[4][4], const _Focal = iFocal; } -void SilhouetteGeomEngine::SetFrustum(real iZNear, real iZFar) +void SilhouetteGeomEngine::setFrustum(real iZNear, real iZFar) { _znear = iZNear; _zfar = iZFar; @@ -117,7 +117,7 @@ void SilhouetteGeomEngine::ProjectSilhouette(vector& ioVertices) { GeomUtils::fromWorldToImage((*sv)->point3D(), newPoint, _modelViewMatrix, _projectionMatrix, _viewport); newPoint[2] = (-newPoint[2]-_znear)/(_zfar-_znear); // normalize Z between 0 and 1 - (*sv)->SetPoint2D(newPoint); + (*sv)->setPoint2D(newPoint); //cerr << (*sv)->point2d().z() << " "; // real d=(*sv)->point2d()[2]; // if (d>max) max =d; @@ -128,7 +128,7 @@ void SilhouetteGeomEngine::ProjectSilhouette(vector& ioVertices) // sv++) // { // Vec3r P((*sv)->point2d()); - // (*sv)->SetPoint2D(Vec3r(P[0], P[1], 1.0-(P[2]-min)/(max-min))); + // (*sv)->setPoint2D(Vec3r(P[0], P[1], 1.0-(P[2]-min)/(max-min))); // //cerr<<(*sv)->point2d()[2]<<" "; // } } @@ -141,7 +141,7 @@ void SilhouetteGeomEngine::ProjectSilhouette(SVertex* ioVertex) vector::iterator sv, svend; GeomUtils::fromWorldToImage(ioVertex->point3D(), newPoint, _modelViewMatrix, _projectionMatrix, _viewport); newPoint[2] = (-newPoint[2]-_znear)/(_zfar-_znear); // normalize Z between 0 and 1 - ioVertex->SetPoint2D(newPoint); + ioVertex->setPoint2D(newPoint); } real SilhouetteGeomEngine::ImageToWorldParameter(FEdge *fe, real t) diff --git a/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.h b/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.h index 159dda1afc0..9638d26986f 100755 --- a/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.h +++ b/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.h @@ -75,7 +75,7 @@ public: } /*! Sets the current viewpoint */ - static inline void SetViewpoint(const Vec3r& ivp) {_Viewpoint = ivp;} + static inline void setViewpoint(const Vec3r& ivp) {_Viewpoint = ivp;} /*! Sets the current transformation * iModelViewMatrix @@ -87,11 +87,11 @@ public: * iFocal * The focal length */ - static void SetTransform(const real iModelViewMatrix[4][4], const real iProjectionMatrix[4][4], const int iViewport[4], real iFocal) ; + static void setTransform(const real iModelViewMatrix[4][4], const real iProjectionMatrix[4][4], const int iViewport[4], real iFocal) ; /*! Sets the current znear and zfar */ - static void SetFrustum(real iZNear, real iZFar) ; + static void setFrustum(real iZNear, real iZFar) ; /* accessors */ static void retrieveViewport(int viewport[4]); diff --git a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp index bf4369bcf41..3feeb6664df 100755 --- a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp +++ b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp @@ -160,7 +160,7 @@ ViewEdge * ViewEdgeXBuilder::BuildSmoothViewEdge(const OWXFaceLayer& iFaceLayer) // Start a new chain edges ViewEdge * newVEdge = new ViewEdge; - newVEdge->SetId(_currentViewId); + newVEdge->setId(_currentViewId); ++_currentViewId; _pCurrentVShape->AddEdge(newVEdge); @@ -174,23 +174,23 @@ ViewEdge * ViewEdgeXBuilder::BuildSmoothViewEdge(const OWXFaceLayer& iFaceLayer) fl!=flend; ++fl){ fe = BuildSmoothFEdge(feprevious, (*fl)); - fe->SetViewEdge(newVEdge); + fe->setViewEdge(newVEdge); if(!fefirst) fefirst = fe; feprevious = fe; } // Store the chain starting edge: _pCurrentSShape->AddChain(fefirst); - newVEdge->SetNature(iFaceLayer.fl->nature()); - newVEdge->SetFEdgeA(fefirst); - newVEdge->SetFEdgeB(fe); + newVEdge->setNature(iFaceLayer.fl->nature()); + newVEdge->setFEdgeA(fefirst); + newVEdge->setFEdgeB(fe); // is it a closed loop ? if((first == end) && (size != 1)){ - fefirst->SetPreviousEdge(fe); - fe->SetNextEdge(fefirst); - newVEdge->SetA(0); - newVEdge->SetB(0); + fefirst->setPreviousEdge(fe); + fe->setNextEdge(fefirst); + newVEdge->setA(0); + newVEdge->setB(0); }else{ ViewVertex *vva = MakeViewVertex(fefirst->vertexA()); ViewVertex *vvb = MakeViewVertex(fe->vertexB()); @@ -198,8 +198,8 @@ ViewEdge * ViewEdgeXBuilder::BuildSmoothViewEdge(const OWXFaceLayer& iFaceLayer) ((NonTVertex*)vva)->AddOutgoingViewEdge(newVEdge); ((NonTVertex*)vvb)->AddIncomingViewEdge(newVEdge); - newVEdge->SetA(vva); - newVEdge->SetB(vvb); + newVEdge->setA(vva); + newVEdge->setB(vvb); } return newVEdge; @@ -208,7 +208,7 @@ ViewEdge * ViewEdgeXBuilder::BuildSmoothViewEdge(const OWXFaceLayer& iFaceLayer) ViewEdge * ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge& iWEdge) { // Start a new sharp chain edges ViewEdge * newVEdge = new ViewEdge; - newVEdge->SetId(_currentViewId); + newVEdge->setId(_currentViewId); ++_currentViewId; unsigned size=0; @@ -248,23 +248,23 @@ ViewEdge * ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge& iWEdge) { we!=weend; ++we){ fe = BuildSharpFEdge(feprevious, (*we)); - fe->SetViewEdge(newVEdge); + fe->setViewEdge(newVEdge); if(!fefirst) fefirst = fe; feprevious = fe; } // Store the chain starting edge: _pCurrentSShape->AddChain(fefirst); - newVEdge->SetNature(iWEdge.e->nature()); - newVEdge->SetFEdgeA(fefirst); - newVEdge->SetFEdgeB(fe); + newVEdge->setNature(iWEdge.e->nature()); + newVEdge->setFEdgeA(fefirst); + newVEdge->setFEdgeB(fe); // is it a closed loop ? if((firstWEdge == endWEdge) && (size!=1)){ - fefirst->SetPreviousEdge(fe); - fe->SetNextEdge(fefirst); - newVEdge->SetA(0); - newVEdge->SetB(0); + fefirst->setPreviousEdge(fe); + fe->setNextEdge(fefirst); + newVEdge->setA(0); + newVEdge->setB(0); }else{ ViewVertex *vva = MakeViewVertex(fefirst->vertexA()); ViewVertex *vvb = MakeViewVertex(fe->vertexB()); @@ -272,8 +272,8 @@ ViewEdge * ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge& iWEdge) { ((NonTVertex*)vva)->AddOutgoingViewEdge(newVEdge); ((NonTVertex*)vvb)->AddIncomingViewEdge(newVEdge); - newVEdge->SetA(vva); - newVEdge->SetB(vvb); + newVEdge->setA(vva); + newVEdge->setB(vvb); } return newVEdge; @@ -468,14 +468,14 @@ FEdge * ViewEdgeXBuilder::BuildSmoothFEdge(FEdge *feprevious, const OWXFaceLayer // Creates the corresponding feature edge fe = new FEdgeSmooth(va, vb); - fe->SetNature(ifl.fl->nature()); - fe->SetId(_currentFId); - fe->SetMaterialIndex(ifl.fl->getFace()->materialIndex()); - fe->SetFace(ifl.fl->getFace()); - fe->SetNormal(normal); - fe->SetPreviousEdge(feprevious); + fe->setNature(ifl.fl->nature()); + fe->setId(_currentFId); + fe->setMaterialIndex(ifl.fl->getFace()->materialIndex()); + fe->setFace(ifl.fl->getFace()); + fe->setNormal(normal); + fe->setPreviousEdge(feprevious); if(feprevious) - feprevious->SetNextEdge(fe); + feprevious->setNextEdge(fe); _pCurrentSShape->AddEdge(fe); va->AddFEdge(fe); vb->AddFEdge(fe); @@ -603,15 +603,15 @@ FEdge * ViewEdgeXBuilder::BuildSharpFEdge(FEdge *feprevious, const OWXEdge& iwe) // Creates the corresponding feature edge // Creates the corresponding feature edge fe = new FEdgeSharp(va, vb); - fe->SetNature(iwe.e->nature()); - fe->SetId(_currentFId); - fe->SetaMaterialIndex(matA); - fe->SetbMaterialIndex(matB); - fe->SetNormalA(normalA); - fe->SetNormalB(normalB); - fe->SetPreviousEdge(feprevious); + fe->setNature(iwe.e->nature()); + fe->setId(_currentFId); + fe->setaMaterialIndex(matA); + fe->setbMaterialIndex(matB); + fe->setNormalA(normalA); + fe->setNormalB(normalB); + fe->setPreviousEdge(feprevious); if(feprevious) - feprevious->SetNextEdge(fe); + feprevious->setNextEdge(fe); _pCurrentSShape->AddEdge(fe); va->AddFEdge(fe); vb->AddFEdge(fe); diff --git a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h index da63fa2f515..28a5d7d9dd4 100755 --- a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h +++ b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h @@ -175,9 +175,9 @@ public: inline int currentFId() const { return _currentFId; } inline int currentSVertexId() const { return _currentSVertexId; } /*! modifiers */ - inline void SetCurrentViewId(int id) { _currentViewId = id; } - inline void SetCurrentFId(int id) { _currentFId = id; } - inline void SetCurrentSVertexId(int id) { _currentSVertexId = id; } + inline void setCurrentViewId(int id) { _currentViewId = id; } + inline void setCurrentFId(int id) { _currentFId = id; } + inline void setCurrentSVertexId(int id) { _currentSVertexId = id; } protected: /*! Init the view edges building */ diff --git a/source/blender/freestyle/intern/view_map/ViewMap.cpp b/source/blender/freestyle/intern/view_map/ViewMap.cpp index 9a2d262b703..e0ae2ca373e 100755 --- a/source/blender/freestyle/intern/view_map/ViewMap.cpp +++ b/source/blender/freestyle/intern/view_map/ViewMap.cpp @@ -144,7 +144,7 @@ TVertex* ViewMap::CreateTVertex(const Vec3r& iA3D, const Vec3r& iA2D, FEdge *iFE else tvertex = new TVertex(Ib,Ia); - tvertex->SetId(id); + tvertex->setId(id); // add these vertices to the view map AddViewVertex(tvertex); @@ -191,18 +191,18 @@ ViewVertex * ViewMap::InsertViewVertex(SVertex *iVertex, // a new VEdge if(ioEdge->A() == 0){ // closed loop - ioEdge->SetA(vva); - ioEdge->SetB(vva); + ioEdge->setA(vva); + ioEdge->setB(vva); // update sshape vshape->sshape()->RemoveEdgeFromChain(ioEdge->fedgeA()); vshape->sshape()->RemoveEdgeFromChain(ioEdge->fedgeB()); - ioEdge->SetFEdgeA(fbegin); - ioEdge->SetFEdgeB(fend); + ioEdge->setFEdgeA(fbegin); + ioEdge->setFEdgeB(fend); // Update FEdges - fend->SetNextEdge(0); - fbegin->SetPreviousEdge(0); + fend->setNextEdge(0); + fbegin->setPreviousEdge(0); // update new View Vertex: vva->AddOutgoingViewEdge(ioEdge); @@ -213,16 +213,16 @@ ViewVertex * ViewMap::InsertViewVertex(SVertex *iVertex, }else{ // Create new ViewEdge ViewEdge * newVEdge = new ViewEdge(vva, ioEdge->B(), fbegin, ioEdge->fedgeB(), vshape); - newVEdge->SetId(Id(ioEdge->getId().getFirst(), ioEdge->getId().getSecond()+1)); - newVEdge->SetNature(ioEdge->getNature()); + newVEdge->setId(Id(ioEdge->getId().getFirst(), ioEdge->getId().getSecond()+1)); + newVEdge->setNature(ioEdge->getNature()); //newVEdge->UpdateFEdges(); // done in the ViewEdge constructor // Update old ViewEdge - ioEdge->SetB(vva); - ioEdge->SetFEdgeB(fend); + ioEdge->setB(vva); + ioEdge->setFEdgeB(fend); // Update FEdges - fend->SetNextEdge(0); - fbegin->SetPreviousEdge(0); + fend->setNextEdge(0); + fbegin->setPreviousEdge(0); // update new View Vertex: vva->AddOutgoingViewEdge(newVEdge); @@ -291,9 +291,9 @@ bool ViewEdgeComp(ViewVertex::directedViewEdge& dve1, ViewVertex::directedViewEd } return false; } -void TVertex::SetFrontEdgeA(ViewEdge *iFrontEdgeA, bool incoming) { +void TVertex::setFrontEdgeA(ViewEdge *iFrontEdgeA, bool incoming) { if (!iFrontEdgeA) { - cerr << "Warning: null pointer passed as argument of TVertex::SetFrontEdgeA()" << endl; + cerr << "Warning: null pointer passed as argument of TVertex::setFrontEdgeA()" << endl; return; } _FrontEdgeA = directedViewEdge(iFrontEdgeA, incoming); @@ -307,9 +307,9 @@ void TVertex::SetFrontEdgeA(ViewEdge *iFrontEdgeA, bool incoming) { else _sortedEdges.push_back(&_FrontEdgeA); } -void TVertex::SetFrontEdgeB(ViewEdge *iFrontEdgeB, bool incoming) { +void TVertex::setFrontEdgeB(ViewEdge *iFrontEdgeB, bool incoming) { if (!iFrontEdgeB) { - cerr << "Warning: null pointer passed as argument of TVertex::SetFrontEdgeB()" << endl; + cerr << "Warning: null pointer passed as argument of TVertex::setFrontEdgeB()" << endl; return; } _FrontEdgeB = directedViewEdge(iFrontEdgeB, incoming); @@ -323,9 +323,9 @@ void TVertex::SetFrontEdgeB(ViewEdge *iFrontEdgeB, bool incoming) { else _sortedEdges.push_back(&_FrontEdgeB); } -void TVertex::SetBackEdgeA(ViewEdge *iBackEdgeA, bool incoming) { +void TVertex::setBackEdgeA(ViewEdge *iBackEdgeA, bool incoming) { if (!iBackEdgeA) { - cerr << "Warning: null pointer passed as argument of TVertex::SetBackEdgeA()" << endl; + cerr << "Warning: null pointer passed as argument of TVertex::setBackEdgeA()" << endl; return; } _BackEdgeA = directedViewEdge(iBackEdgeA, incoming); @@ -339,9 +339,9 @@ void TVertex::SetBackEdgeA(ViewEdge *iBackEdgeA, bool incoming) { else _sortedEdges.push_back(&_BackEdgeA); } -void TVertex::SetBackEdgeB(ViewEdge *iBackEdgeB, bool incoming) { +void TVertex::setBackEdgeB(ViewEdge *iBackEdgeB, bool incoming) { if (!iBackEdgeB) { - cerr << "Warning: null pointer passed as argument of TVertex::SetBackEdgeB()" << endl; + cerr << "Warning: null pointer passed as argument of TVertex::setBackEdgeB()" << endl; return; } _BackEdgeB = directedViewEdge(iBackEdgeB, incoming); @@ -694,10 +694,10 @@ void ViewEdge::UpdateFEdges() FEdge *currentEdge = _FEdgeA; do { - currentEdge->SetViewEdge(this); + currentEdge->setViewEdge(this); currentEdge = currentEdge->nextEdge(); }while((currentEdge != NULL) && (currentEdge!= _FEdgeB)); // last one - _FEdgeB->SetViewEdge(this); + _FEdgeB->setViewEdge(this); } diff --git a/source/blender/freestyle/intern/view_map/ViewMap.h b/source/blender/freestyle/intern/view_map/ViewMap.h index 416b7e8f23f..2691da20057 100755 --- a/source/blender/freestyle/intern/view_map/ViewMap.h +++ b/source/blender/freestyle/intern/view_map/ViewMap.h @@ -427,8 +427,8 @@ public: _FrontEdgeB.first = 0; _BackEdgeA.first = 0; _BackEdgeB.first = 0; - svFront->SetViewVertex(this); - svBack->SetViewVertex(this); + svFront->setViewVertex(this); + svBack->setViewVertex(this); } protected: @@ -465,15 +465,15 @@ public: /* modifiers */ /*! Sets the SVertex that is closer to the viewpoint. */ - inline void SetFrontVertex(SVertex *iFrontSVertex) {_FrontSVertex = iFrontSVertex;_FrontSVertex->SetViewVertex(this);} + inline void setFrontVertex(SVertex *iFrontSVertex) {_FrontSVertex = iFrontSVertex;_FrontSVertex->setViewVertex(this);} /*! Sets the SVertex that is further away from the viewpoint. */ - inline void SetBackSVertex(SVertex *iBackSVertex) {_BackSVertex = iBackSVertex;_BackSVertex->SetViewVertex(this);} - void SetFrontEdgeA(ViewEdge *iFrontEdgeA, bool incoming=true); - void SetFrontEdgeB(ViewEdge *iFrontEdgeB, bool incoming=true) ; - void SetBackEdgeA(ViewEdge *iBackEdgeA, bool incoming=true); - void SetBackEdgeB(ViewEdge *iBackEdgeB, bool incoming=true) ; + inline void setBackSVertex(SVertex *iBackSVertex) {_BackSVertex = iBackSVertex;_BackSVertex->setViewVertex(this);} + void setFrontEdgeA(ViewEdge *iFrontEdgeA, bool incoming=true); + void setFrontEdgeB(ViewEdge *iFrontEdgeB, bool incoming=true) ; + void setBackEdgeA(ViewEdge *iBackEdgeA, bool incoming=true); + void setBackEdgeB(ViewEdge *iBackEdgeB, bool incoming=true) ; /*! Sets the Id. */ - inline void SetId(const Id& iId) {_Id = iId;} + inline void setId(const Id& iId) {_Id = iId;} /*! Returns the SVertex (among the 2) belonging to the FEdge iFEdge */ inline SVertex * GetSVertex(FEdge *iFEdge) @@ -641,7 +641,7 @@ public: inline NonTVertex(SVertex* iSVertex) : ViewVertex(Nature::NON_T_VERTEX) { _SVertex = iSVertex; - _SVertex->SetViewVertex(this); + _SVertex->setViewVertex(this); } protected: /*! Copy constructor. */ @@ -649,7 +649,7 @@ protected: : ViewVertex(iBrother) { _SVertex = iBrother._SVertex; - _SVertex->SetViewVertex(this); + _SVertex->setViewVertex(this); _ViewEdges = iBrother._ViewEdges; } /*! Cloning method. */ @@ -669,8 +669,8 @@ public: /* modifiers */ /*! Sets the SVertex on top of which this NonTVertex is built. */ - inline void SetSVertex(SVertex *iSVertex) {_SVertex = iSVertex;_SVertex->SetViewVertex(this);} - inline void SetViewEdges(const vector& iViewEdges) {_ViewEdges = iViewEdges;} + inline void setSVertex(SVertex *iSVertex) {_SVertex = iSVertex;_SVertex->setViewVertex(this);} + inline void setViewEdges(const vector& iViewEdges) {_ViewEdges = iViewEdges;} void AddIncomingViewEdge(ViewEdge * iVEdge) ; void AddOutgoingViewEdge(ViewEdge * iVEdge) ; inline void AddViewEdge(ViewEdge * iVEdge, bool incoming=true) { @@ -938,28 +938,28 @@ public: /* modifiers */ /*! Sets the first ViewVertex of the ViewEdge. */ - inline void SetA(ViewVertex* iA) { __A = iA; } + inline void setA(ViewVertex* iA) { __A = iA; } /*! Sets the last ViewVertex of the ViewEdge. */ - inline void SetB(ViewVertex* iB) { __B = iB; } + inline void setB(ViewVertex* iB) { __B = iB; } /*! Sets the nature of the ViewEdge. */ - inline void SetNature(Nature::EdgeNature iNature) { _Nature = iNature; } + inline void setNature(Nature::EdgeNature iNature) { _Nature = iNature; } /*! Sets the first FEdge of the ViewEdge. */ - inline void SetFEdgeA(FEdge* iFEdge) { _FEdgeA = iFEdge; } + inline void setFEdgeA(FEdge* iFEdge) { _FEdgeA = iFEdge; } /*! Sets the last FEdge of the ViewEdge. */ - inline void SetFEdgeB(FEdge* iFEdge) { _FEdgeB = iFEdge; } + inline void setFEdgeB(FEdge* iFEdge) { _FEdgeB = iFEdge; } /*! Sets the ViewShape to which this ViewEdge belongs to.*/ - inline void SetShape(ViewShape *iVShape) + inline void setShape(ViewShape *iVShape) { _Shape = iVShape; } /*! Sets the ViewEdge id. */ - inline void SetId(const Id& id) {_Id = id;} + inline void setId(const Id& id) {_Id = id;} /*! Sets Viewedge to this for all embedded fedges */ void UpdateFEdges(); /*! Sets the occluded ViewShape */ - inline void SetaShape(ViewShape * iShape) {_aShape = iShape;} + inline void setaShape(ViewShape * iShape) {_aShape = iShape;} /*! Sets the quantitative invisibility value. */ - inline void SetQI(int qi) {_qi = qi;} + inline void setQI(int qi) {_qi = qi;} /*! Sets the time stamp value. */ inline void setChainingTimeStamp(unsigned ts) {_ChainingTimeStamp = ts;} inline void AddOccluder(ViewShape *iShape) {_Occluders.push_back(iShape);} @@ -1099,7 +1099,7 @@ public: /*! Default constructor.*/ inline ViewShape() { userdata = 0; _SShape = 0;} /*! Builds a ViewShape from a SShape. */ - inline ViewShape(SShape *iSShape) {userdata = 0; _SShape = iSShape;}//_SShape->SetViewShape(this);} + inline ViewShape(SShape *iSShape) {userdata = 0; _SShape = iSShape;}//_SShape->setViewShape(this);} /*! Copy constructor. */ inline ViewShape(ViewShape& iBrother) { @@ -1146,10 +1146,10 @@ public: 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); - v->SetBackEdgeA(veBackA, v->backEdgeA().second); - v->SetBackEdgeB(veBackB, v->backEdgeB().second); + v->setFrontEdgeA(veFrontA, v->frontEdgeA().second); + v->setFrontEdgeB(veFrontB, v->frontEdgeB().second); + v->setBackEdgeA(veBackA, v->backEdgeA().second); + v->setBackEdgeB(veBackB, v->backEdgeB().second); } break; case Nature::NON_T_VERTEX: @@ -1164,7 +1164,7 @@ public: ViewEdge *current = (ViewEdge*)((ve)->first)->userdata; newEdges.push_back(ViewVertex::directedViewEdge(current, ve->second)); } - (v)->SetViewEdges(newEdges); + (v)->setViewEdges(newEdges); } break; default: @@ -1179,8 +1179,8 @@ public: 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 //--------------------------------------- @@ -1253,11 +1253,11 @@ public: /* modifiers */ /*! Sets the SShape on top of which the ViewShape is built. */ - inline void SetSShape(SShape* iSShape) {_SShape = iSShape;} + inline void setSShape(SShape* iSShape) {_SShape = iSShape;} /*! Sets the list of ViewVertex contained in this ViewShape. */ - inline void SetVertices(const vector& iVertices) {_Vertices = iVertices;} + inline void setVertices(const vector& iVertices) {_Vertices = iVertices;} /*! Sets the list of ViewEdge contained in this ViewShape. */ - inline void SetEdges(const vector& iEdges) {_Edges = iEdges;} + inline void setEdges(const vector& iEdges) {_Edges = iEdges;} /*! Adds a ViewVertex to the list. */ inline void AddVertex(ViewVertex *iVertex) { @@ -1268,7 +1268,7 @@ public: inline void AddEdge(ViewEdge *iEdge) { _Edges.push_back(iEdge); - iEdge->SetShape(this); + iEdge->setShape(this); //_SShape->AddNewEdge(iEdge->fedge()); } @@ -1358,13 +1358,13 @@ void ViewShape::SplitEdge(FEdge *fe, // remove the chain that was starting by the fedge A of vEdge (which is different from fe !!!!) shape->RemoveEdgeFromChain(vEdge->fedgeA()); // we set - vEdge->SetA(*vv); - vEdge->SetB(*vv); - vEdge->SetFEdgeA(newEdge); + vEdge->setA(*vv); + vEdge->setB(*vv); + vEdge->setFEdgeA(newEdge); //FEdge *previousEdge = newEdge->previousEdge(); - vEdge->SetFEdgeB(fe); + vEdge->setFEdgeB(fe); newVEdge = vEdge; - vEdge->fedgeA()->SetViewEdge(newVEdge); + vEdge->fedgeA()->setViewEdge(newVEdge); } else { @@ -1372,15 +1372,15 @@ void ViewShape::SplitEdge(FEdge *fe, // while we create the view edge, it updates the "ViewEdge" pointer // of every underlying FEdges to this. newVEdge = new ViewEdge((*vv),vvb);//, newEdge, vEdge->fedgeB()); - newVEdge->SetNature((fe)->getNature()); - newVEdge->SetFEdgeA(newEdge); - //newVEdge->SetFEdgeB(fe); + newVEdge->setNature((fe)->getNature()); + newVEdge->setFEdgeA(newEdge); + //newVEdge->setFEdgeB(fe); // If our original viewedge is made of one FEdge, // then if((vEdge->fedgeA() == vEdge->fedgeB()) || (fe == vEdge->fedgeB())) - newVEdge->SetFEdgeB(newEdge); + newVEdge->setFEdgeB(newEdge); else - newVEdge->SetFEdgeB(vEdge->fedgeB()); //MODIF + newVEdge->setFEdgeB(vEdge->fedgeB()); //MODIF Id * newId = vEdge->splittingId(); if(newId == 0){ @@ -1388,11 +1388,11 @@ void ViewShape::SplitEdge(FEdge *fe, vEdge->setSplittingId(newId); } newId->setSecond(newId->getSecond()+1); - newVEdge->SetId(*newId); + newVEdge->setId(*newId); newVEdge->setSplittingId(newId); // Id id(vEdge->getId().getFirst(), vEdge->getId().getSecond()+1); - // newVEdge->SetId(vEdge->getId()); - // vEdge->SetId(id); + // newVEdge->setId(vEdge->getId()); + // vEdge->setId(id); AddEdge(newVEdge); // here this shape is set as the edge's shape @@ -1405,8 +1405,8 @@ void ViewShape::SplitEdge(FEdge *fe, vvb->Replace((vEdge), newVEdge); // we split the view edge: - vEdge->SetB((*vv)); - vEdge->SetFEdgeB(fe); //MODIF + vEdge->setB((*vv)); + vEdge->setFEdgeB(fe); //MODIF // Update fedges so that they point to the new viewedge: newVEdge->UpdateFEdges(); @@ -1418,14 +1418,14 @@ void ViewShape::SplitEdge(FEdge *fe, if(sv == (*vv)->frontSVertex()) { // -- View Vertex A' -- - (*vv)->SetFrontEdgeA(vEdge, true); - (*vv)->SetFrontEdgeB(newVEdge, false); + (*vv)->setFrontEdgeA(vEdge, true); + (*vv)->setFrontEdgeB(newVEdge, false); } else { // -- View Vertex A' -- - (*vv)->SetBackEdgeA(vEdge, true); - (*vv)->SetBackEdgeB(newVEdge, false); + (*vv)->setBackEdgeA(vEdge, true); + (*vv)->setBackEdgeB(newVEdge, false); } } } diff --git a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp index 32f5283a63c..89e91e4f2c8 100755 --- a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp +++ b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp @@ -55,17 +55,17 @@ void ViewMapBuilder::computeInitialViewEdges(WingedEdge& we) it++) { // create the embedding psShape = new SShape; - psShape->SetId((*it)->GetId()); - psShape->SetMaterials((*it)->materials()); // FIXME + psShape->setId((*it)->GetId()); + psShape->setMaterials((*it)->materials()); // FIXME // create the view shape ViewShape * vshape = new ViewShape(psShape); // add this view shape to the view map: _ViewMap->AddViewShape(vshape); - _pViewEdgeBuilder->SetCurrentViewId(_currentId); // we want to number the view edges in a unique way for the while scene. - _pViewEdgeBuilder->SetCurrentFId(_currentFId); // we want to number the feature edges in a unique way for the while scene. - _pViewEdgeBuilder->SetCurrentSVertexId(_currentFId); // we want to number the SVertex in a unique way for the while scene. + _pViewEdgeBuilder->setCurrentViewId(_currentId); // we want to number the view edges in a unique way for the while scene. + _pViewEdgeBuilder->setCurrentFId(_currentFId); // we want to number the feature edges in a unique way for the while scene. + _pViewEdgeBuilder->setCurrentSVertexId(_currentFId); // we want to number the SVertex in a unique way for the while scene. _pViewEdgeBuilder->BuildViewEdges(dynamic_cast(*it), vshape, _ViewMap->ViewEdges(), _ViewMap->ViewVertices(), @@ -239,12 +239,12 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, Grid* iGrid FindOccludee(fe, iGrid, epsilon, &aFace, timestamp++); if(aFace) { - fe->SetaFace(*aFace); + fe->setaFace(*aFace); aFaces.push_back(aFace); - fe->SetOccludeeEmpty(false); + fe->setOccludeeEmpty(false); } else - fe->SetOccludeeEmpty(true); + fe->setOccludeeEmpty(true); ++nSamples; fe = fe->nextEdge(); @@ -253,7 +253,7 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, Grid* iGrid // ViewEdge // qi -- - (*ve)->SetQI(maxIndex); + (*ve)->setQI(maxIndex); // occluders -- for(set::iterator o=occluders.begin(), oend=occluders.end(); o!=oend; @@ -264,7 +264,7 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, Grid* iGrid { if(aFaces.size() <= (float)nSamples/2.f) { - (*ve)->SetaShape(0); + (*ve)->setaShape(0); } else { @@ -272,7 +272,7 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, Grid* iGrid WFace * wface = (WFace*)((*p)->userdata); ViewShape *vshape = ioViewMap->viewShape(wface->GetVertex(0)->shape()->GetId()); ++p; - (*ve)->SetaShape(vshape); + (*ve)->setaShape(vshape); } } @@ -360,7 +360,7 @@ void ViewMapBuilder::ComputeFastRayCastingVisibility(ViewMap *ioViewMap, Grid* i if(aFace) { - fe->SetaFace(*aFace); + fe->setaFace(*aFace); aFaces.push_back(aFace); } ++nSamples; @@ -371,13 +371,13 @@ void ViewMapBuilder::ComputeFastRayCastingVisibility(ViewMap *ioViewMap, Grid* i fe = fe->nextEdge(); } while ((maxCard < qiMajority) && (0!=fe) && (fe!=festart)); - (*ve)->SetQI(maxIndex); + (*ve)->setQI(maxIndex); if(!aFaces.empty()) { if(aFaces.size() < nSamples / 2) { - (*ve)->SetaShape(0); + (*ve)->setaShape(0); } else { @@ -398,11 +398,11 @@ void ViewMapBuilder::ComputeFastRayCastingVisibility(ViewMap *ioViewMap, Grid* i // } // } // if(sameShape) - (*ve)->SetaShape(vshape); + (*ve)->setaShape(vshape); } } - //(*ve)->SetaFace(aFace); + //(*ve)->setaFace(aFace); if(progressBarDisplay) { counter--; @@ -448,17 +448,17 @@ void ViewMapBuilder::ComputeVeryFastRayCastingVisibility(ViewMap *ioViewMap, Gri qi = ComputeRayCastingVisibility(fe, iGrid, epsilon, occluders, &aFace, timestamp++); if(aFace) { - fe->SetaFace(*aFace); + fe->setaFace(*aFace); WFace * wface = (WFace*)(aFace->userdata); ViewShape *vshape = ioViewMap->viewShape(wface->GetVertex(0)->shape()->GetId()); - (*ve)->SetaShape(vshape); + (*ve)->setaShape(vshape); } else { - (*ve)->SetaShape(0); + (*ve)->setaShape(0); } - (*ve)->SetQI(qi); + (*ve)->setQI(qi); if(progressBarDisplay) { counter--; @@ -562,7 +562,7 @@ void ViewMapBuilder::FindOccludee(FEdge *fe, Grid* iGrid, real epsilon, Polygon3 *oaPolygon = (*p); mint = t; noIntersection = false; - fe->SetOccludeeIntersection(Vec3r(A+t*v)); + fe->setOccludeeIntersection(Vec3r(A+t*v)); } } } diff --git a/source/blender/freestyle/intern/view_map/ViewMapBuilder.h b/source/blender/freestyle/intern/view_map/ViewMapBuilder.h index ec52d4fdd7e..5ac100bae15 100755 --- a/source/blender/freestyle/intern/view_map/ViewMapBuilder.h +++ b/source/blender/freestyle/intern/view_map/ViewMapBuilder.h @@ -113,7 +113,7 @@ public: /*! Sets the current viewpoint */ - inline void SetViewpoint(const Vec3r& ivp) {_viewpoint = ivp; SilhouetteGeomEngine::SetViewpoint(ivp);} + inline void setViewpoint(const Vec3r& ivp) {_viewpoint = ivp; SilhouetteGeomEngine::setViewpoint(ivp);} /*! Sets the current transformation * iModelViewMatrix @@ -123,17 +123,17 @@ public: * iViewport * The viewport. 4 real array: origin.x, origin.y, width, length */ - inline void SetTransform(const real iModelViewMatrix[4][4], + inline void setTransform(const real iModelViewMatrix[4][4], const real iProjectionMatrix[4][4], const int iViewport[4], real iFocalLength, real iAspect, real iFovy) { - SilhouetteGeomEngine::SetTransform(iModelViewMatrix, iProjectionMatrix, iViewport, iFocalLength); + SilhouetteGeomEngine::setTransform(iModelViewMatrix, iProjectionMatrix, iViewport, iFocalLength); } - inline void SetFrustum(real iZnear, real iZfar) { - SilhouetteGeomEngine::SetFrustum(iZnear, iZfar); + inline void setFrustum(real iZnear, real iZfar) { + SilhouetteGeomEngine::setFrustum(iZnear, iZfar); } /*! Builds the scene view map @@ -164,13 +164,13 @@ public: */ void ComputeEdgesVisibility(ViewMap *ioViewMap, visibility_algo iAlgo= ray_casting, Grid* iGrid = 0, real epsilon=1e-6); - void SetGrid(Grid *iGrid) {_Grid = iGrid;} + void setGrid(Grid *iGrid) {_Grid = iGrid;} /*! accessors */ /*! Modifiers */ - inline void SetProgressBar(ProgressBar *iProgressBar) {_pProgressBar = iProgressBar;} - inline void SetEnableQI(bool iBool) {_EnableQI = iBool;} + inline void setProgressBar(ProgressBar *iProgressBar) {_pProgressBar = iProgressBar;} + inline void setEnableQI(bool iBool) {_EnableQI = iBool;} protected: diff --git a/source/blender/freestyle/intern/view_map/ViewMapIO.cpp b/source/blender/freestyle/intern/view_map/ViewMapIO.cpp index 4e2796113c8..370f44dffcf 100755 --- a/source/blender/freestyle/intern/view_map/ViewMapIO.cpp +++ b/source/blender/freestyle/intern/view_map/ViewMapIO.cpp @@ -99,26 +99,26 @@ namespace ViewMapIO { // Diffuse for (i = 0; i < 4; i++) READ(tmp_array[i]); - m.SetDiffuse(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]); + m.setDiffuse(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]); // Specular for (i = 0; i < 4; i++) READ(tmp_array[i]); - m.SetSpecular(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]); + m.setSpecular(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]); // Ambient for (i = 0; i < 4; i++) READ(tmp_array[i]); - m.SetAmbient(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]); + m.setAmbient(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]); // Emission for (i = 0; i < 4; i++) READ(tmp_array[i]); - m.SetEmission(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]); + m.setEmission(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]); // Shininess READ(tmp_array[0]); - m.SetShininess(tmp_array[0]); + m.setShininess(tmp_array[0]); return 0; } @@ -135,12 +135,12 @@ namespace ViewMapIO { Id::id_type id1, id2; READ(id1); READ(id2); - vs->sshape()->SetId(Id(id1, id2)); + vs->sshape()->setId(Id(id1, id2)); // -> Importance float importance; READ(importance); - vs->sshape()->SetImportance(importance); + vs->sshape()->setImportance(importance); // -> BBox // Not necessary (only used during view map computatiom) @@ -155,7 +155,7 @@ namespace ViewMapIO { load(in, m); materials.push_back(m); } - vs->sshape()->SetMaterials(materials); + vs->sshape()->setMaterials(materials); @@ -222,51 +222,51 @@ namespace ViewMapIO { Id::id_type id1, id2; READ(id1); READ(id2); - fe->SetId(Id(id1, id2)); + fe->setId(Id(id1, id2)); // Nature Nature::EdgeNature nature; READ(nature); - fe->SetNature(nature); + fe->setNature(nature); // hasVisibilityPoint // bool b; // READ(b); - // fe->SetHasVisibilityPoint(b); + // fe->setHasVisibilityPoint(b); Vec3r v; unsigned int matindex; // VisibilityPointA // load(in, v); - // fe->SetVisibilityPointA(v); + // fe->setVisibilityPointA(v); // VisibilityPointB // load(in, v); - // fe->SetVisibilityPointB(v); + // fe->setVisibilityPointB(v); if(fe->isSmooth()){ // Normal load(in, v); - fesmooth->SetNormal(v); + fesmooth->setNormal(v); // Material READ(matindex); - fesmooth->SetMaterialIndex(matindex); + fesmooth->setMaterialIndex(matindex); }else{ // aNormal load(in, v); - fesharp->SetNormalA(v); + fesharp->setNormalA(v); // bNormal load(in, v); - fesharp->SetNormalB(v); + fesharp->setNormalB(v); // Materials READ(matindex); - fesharp->SetaMaterialIndex(matindex); + fesharp->setaMaterialIndex(matindex); READ(matindex); - fesharp->SetbMaterialIndex(matindex); + fesharp->setbMaterialIndex(matindex); } unsigned tmp; @@ -274,27 +274,27 @@ namespace ViewMapIO { // VertexA SVertex* sva; READ_IF_NON_NULL(sva, g_vm->SVertices()); - fe->SetVertexA(sva); + fe->setVertexA(sva); // VertexB SVertex* svb; READ_IF_NON_NULL(svb, g_vm->SVertices()); - fe->SetVertexB(svb); + fe->setVertexB(svb); // NextEdge FEdge* nfe; READ_IF_NON_NULL(nfe, g_vm->FEdges()); - fe->SetNextEdge(nfe); + fe->setNextEdge(nfe); // PreviousEdge FEdge* pfe; READ_IF_NON_NULL(pfe, g_vm->FEdges()); - fe->SetPreviousEdge(pfe); + fe->setPreviousEdge(pfe); // ViewEdge ViewEdge* ve; READ_IF_NON_NULL(ve, g_vm->ViewEdges()); - fe->SetViewEdge(ve); + fe->setViewEdge(ve); // Face // Not necessary (only used during view map computatiom) @@ -303,15 +303,15 @@ namespace ViewMapIO { // aFace load(in, p); - fe->SetaFace(p); + fe->setaFace(p); // occludeeEmpty READ(b); - fe->SetOccludeeEmpty(b); + fe->setOccludeeEmpty(b); // occludeeIntersection load(in, v); - fe->SetOccludeeIntersection(v); + fe->setOccludeeIntersection(v); return 0; } @@ -326,29 +326,29 @@ namespace ViewMapIO { Id::id_type id1, id2; READ(id1); READ(id2); - sv->SetId(Id(id1, id2)); + sv->setId(Id(id1, id2)); Vec3r v; // Point3D load(in, v); - sv->SetPoint3D(v); + sv->setPoint3D(v); // Point2D load(in, v); - sv->SetPoint2D(v); + sv->setPoint2D(v); unsigned tmp; // Shape ViewShape* vs; READ_IF_NON_NULL(vs, g_vm->ViewShapes()); - sv->SetShape(vs->sshape()); + sv->setShape(vs->sshape()); // pViewVertex ViewVertex* vv; READ_IF_NON_NULL(vv, g_vm->ViewVertices()); - sv->SetViewVertex(vv); + sv->setViewVertex(vv); unsigned i, size; @@ -382,46 +382,46 @@ namespace ViewMapIO { Id::id_type id1, id2; READ(id1); READ(id2); - ve->SetId(Id(id1, id2)); + ve->setId(Id(id1, id2)); // Nature Nature::EdgeNature nature; READ(nature); - ve->SetNature(nature); + ve->setNature(nature); // QI READ(tmp); - ve->SetQI(tmp); + ve->setQI(tmp); // Shape ViewShape* vs; READ_IF_NON_NULL(vs, g_vm->ViewShapes()); - ve->SetShape(vs); + ve->setShape(vs); // aShape ViewShape* avs; READ_IF_NON_NULL(avs, g_vm->ViewShapes()); - ve->SetaShape(avs); + ve->setaShape(avs); // FEdgeA FEdge* fea; READ_IF_NON_NULL(fea, g_vm->FEdges()); - ve->SetFEdgeA(fea); + ve->setFEdgeA(fea); // FEdgeB FEdge* feb; READ_IF_NON_NULL(feb, g_vm->FEdges()); - ve->SetFEdgeB(feb); + ve->setFEdgeB(feb); // A ViewVertex* vva; READ_IF_NON_NULL(vva, g_vm->ViewVertices()); - ve->SetA(vva); + ve->setA(vva); // B ViewVertex* vvb; READ_IF_NON_NULL(vvb, g_vm->ViewVertices()); - ve->SetB(vvb); + ve->setB(vvb); // Occluders (List) if (!(Options::getFlags() & Options::NO_OCCLUDERS)) { @@ -458,41 +458,41 @@ namespace ViewMapIO { Id::id_type id1, id2; READ(id1); READ(id2); - tv->SetId(Id(id1, id2)); + tv->setId(Id(id1, id2)); // FrontSVertex SVertex* fsv; READ_IF_NON_NULL(fsv, g_vm->SVertices()); - tv->SetFrontVertex(fsv); + tv->setFrontVertex(fsv); // BackSVertex SVertex* bsv; READ_IF_NON_NULL(bsv, g_vm->SVertices()); - tv->SetBackSVertex(bsv); + tv->setBackSVertex(bsv); // FrontEdgeA ViewEdge* fea; READ_IF_NON_NULL(fea, g_vm->ViewEdges()); READ(b); - tv->SetFrontEdgeA(fea, b); + tv->setFrontEdgeA(fea, b); // FrontEdgeB ViewEdge* feb; READ_IF_NON_NULL(feb, g_vm->ViewEdges()); READ(b); - tv->SetFrontEdgeB(feb, b); + tv->setFrontEdgeB(feb, b); // BackEdgeA ViewEdge* bea; READ_IF_NON_NULL(bea, g_vm->ViewEdges()); READ(b); - tv->SetBackEdgeA(bea, b); + tv->setBackEdgeA(bea, b); // BackEdgeB ViewEdge* beb; READ_IF_NON_NULL(beb, g_vm->ViewEdges()); READ(b); - tv->SetBackEdgeB(beb, b); + tv->setBackEdgeB(beb, b); } else if (vv->getNature() & Nature::NON_T_VERTEX) { NonTVertex* ntv = dynamic_cast(vv); @@ -500,7 +500,7 @@ namespace ViewMapIO { // SVertex SVertex* sv; READ_IF_NON_NULL(sv, g_vm->SVertices()); - ntv->SetSVertex(sv); + ntv->setSVertex(sv); // ViewEdges (List) unsigned size; @@ -1015,8 +1015,8 @@ namespace ViewMapIO { for (unsigned i0 = 0; i0 < vs_s; i0++) { SShape* ss = new SShape(); ViewShape* vs = new ViewShape(); - vs->SetSShape(ss); - ss->SetViewShape(vs); + vs->setSShape(ss); + ss->setViewShape(vs); vm->AddViewShape(vs); } // for (unsigned i1 = 0; i1 < fe_s; i1++) { diff --git a/source/blender/freestyle/intern/view_map/ViewMapTesselator.h b/source/blender/freestyle/intern/view_map/ViewMapTesselator.h index fc1ec8e373e..2d054d8a067 100755 --- a/source/blender/freestyle/intern/view_map/ViewMapTesselator.h +++ b/source/blender/freestyle/intern/view_map/ViewMapTesselator.h @@ -49,7 +49,7 @@ class LIB_VIEW_MAP_EXPORT ViewMapTesselator { public: - inline ViewMapTesselator() {_nature = Nature::SILHOUETTE | Nature::BORDER | Nature::CREASE;_Material.SetDiffuse(0,0,0,1);_overloadMaterial=false;} + inline ViewMapTesselator() {_nature = Nature::SILHOUETTE | Nature::BORDER | Nature::CREASE;_Material.setDiffuse(0,0,0,1);_overloadMaterial=false;} virtual ~ViewMapTesselator() {} /*! Builds a set of lines rep contained under a @@ -70,8 +70,8 @@ public: NodeGroup* Tesselate(WShape* iWShape); - inline void SetNature(Nature::EdgeNature iNature) {_nature = iNature;} - inline void SetMaterial(const Material& iMaterial) {_Material=iMaterial;_overloadMaterial=true;} + inline void setNature(Nature::EdgeNature iNature) {_nature = iNature;} + inline void setMaterial(const Material& iMaterial) {_Material=iMaterial;_overloadMaterial=true;} inline Nature::EdgeNature nature() {return _nature;} inline const Material& material() const {return _Material;} @@ -123,8 +123,8 @@ NodeGroup * ViewMapTesselator::Tesselate(ViewEdgesIterator begin, ViewEdgesItera NodeGroup *group = new NodeGroup; NodeShape *tshape = new NodeShape; group->AddChild(tshape); - //tshape->material().SetDiffuse(0.f, 0.f, 0.f, 1.f); - tshape->SetMaterial(_Material); + //tshape->material().setDiffuse(0.f, 0.f, 0.f, 1.f); + tshape->setMaterial(_Material); LineRep* line; @@ -153,12 +153,12 @@ NodeGroup * ViewMapTesselator::Tesselate(ViewEdgesIterator begin, ViewEdgesItera line = new OrientedLineRep(); if(_overloadMaterial) - line->SetMaterial(_Material); + line->setMaterial(_Material); // there might be chains containing a single element if(0 == (firstEdge)->nextEdge()) { - line->SetStyle(LineRep::LINES); + line->setStyle(LineRep::LINES); // line->AddVertex((*c)->vertexA()->point3D()); // line->AddVertex((*c)->vertexB()->point3D()); AddVertexToLine(line, firstEdge->vertexA()); @@ -166,7 +166,7 @@ NodeGroup * ViewMapTesselator::Tesselate(ViewEdgesIterator begin, ViewEdgesItera } else { - line->SetStyle(LineRep::LINE_STRIP); + line->setStyle(LineRep::LINE_STRIP); //firstEdge = (*c); nextFEdge = firstEdge; @@ -184,7 +184,7 @@ NodeGroup * ViewMapTesselator::Tesselate(ViewEdgesIterator begin, ViewEdgesItera } - line->SetId((*c)->getId().getFirst()); + line->setId((*c)->getId().getFirst()); line->ComputeBBox(); tshape->AddRep(line); id++; -- cgit v1.2.3