diff --git a/Common/LuaBindings.cpp b/Common/LuaBindings.cpp index 9af49dc8264a8f83cfbd92fbc4bebbec900a61d9..73c2a99b6727a1603dbaee8a09164e7b43b21adc 100644 --- a/Common/LuaBindings.cpp +++ b/Common/LuaBindings.cpp @@ -439,7 +439,8 @@ binding::~binding() } } -void *binding::checkudata_with_inheritance (lua_State *L, int ud, const char *tname) { +void *binding::checkudata_with_inheritance (lua_State *L, int ud, const char *tname) +{ void *p = lua_touserdata(L, ud); if (!p) return NULL; diff --git a/Common/LuaBindings.h b/Common/LuaBindings.h index b0759438f3e2e835a8c090d92e7b821ec5a269aa..931c38b656ee55ef128cd644943c03c16c511fd0 100644 --- a/Common/LuaBindings.h +++ b/Common/LuaBindings.h @@ -298,7 +298,8 @@ class luaStack<type *>{ public: static type* get(lua_State *L, int ia) { - userdataType *ud=static_cast<userdataType*>(binding::checkudata_with_inheritance (L, ia, getName().c_str())); + userdataType *ud = static_cast<userdataType*> + (binding::checkudata_with_inheritance (L, ia, getName().c_str())); if(!ud) luaL_typerror(L, ia, className<type>::get().c_str()); return ud->pT; } @@ -323,7 +324,8 @@ class luaStack<const type *>{ public: static type* get(lua_State *L, int ia) { - userdataType *ud=static_cast<userdataType*>(binding::checkudata_with_inheritance (L, ia, getName().c_str())); + userdataType *ud = static_cast<userdataType*> + (binding::checkudata_with_inheritance (L, ia, getName().c_str())); if(!ud) luaL_typerror(L, ia, className<type>::get().c_str()); return ud->pT; } @@ -348,7 +350,8 @@ class luaStack<type &>{ public: static type& get(lua_State *L, int ia) { - userdataType *ud=static_cast<userdataType*>(binding::checkudata_with_inheritance (L, ia, getName().c_str())); + userdataType *ud = static_cast<userdataType*> + (binding::checkudata_with_inheritance (L, ia, getName().c_str())); if(!ud) luaL_typerror(L, ia, className<type>::get().c_str()); return *ud->pT; } @@ -364,7 +367,8 @@ class luaStack<const type &>{ public: static type& get(lua_State *L, int ia) { - userdataType *ud=static_cast<userdataType*>(binding::checkudata_with_inheritance (L, ia, getName().c_str())); + userdataType *ud = static_cast<userdataType*> + (binding::checkudata_with_inheritance (L, ia, getName().c_str())); if(!ud) luaL_typerror(L, ia, className<type>::get().c_str()); return *ud->pT; } diff --git a/Geo/ACISFace.h b/Geo/ACISFace.h index dcfe9a4adb978605c51aaa3fda00599a8fccff1f..15b1bc579f200b32d0656689eb69d2fb4c9ef27a 100644 --- a/Geo/ACISFace.h +++ b/Geo/ACISFace.h @@ -28,7 +28,8 @@ class ACISFace : public GFace { virtual double period(int dir) const; Range<double> parBounds(int i) const; virtual GPoint point(double par1, double par2) const; - virtual GPoint closestPoint(const SPoint3 & queryPoint, const double initialGuess[2]) const; + virtual GPoint closestPoint(const SPoint3 & queryPoint, + const double initialGuess[2]) const; virtual bool containsPoint(const SPoint3 &pt) const; virtual SVector3 normal(const SPoint2 ¶m) const; virtual Pair<SVector3,SVector3> firstDer(const SPoint2 ¶m) const; diff --git a/Geo/ExtrudeParams.cpp b/Geo/ExtrudeParams.cpp index 03393e9f60c5bdb7337dca1fd9a3d05f70cbb8b6..46967b0da1dd7225a8bbd4e66e7bf7582f6576ec 100644 --- a/Geo/ExtrudeParams.cpp +++ b/Geo/ExtrudeParams.cpp @@ -11,11 +11,9 @@ smooth_data* ExtrudeParams::normals = 0; static void Projette(double p[3], double mat[3][3]) { - double X, Y, Z; - - X = p[0] * mat[0][0] + p[1] * mat[0][1] + p[2] * mat[0][2]; - Y = p[0] * mat[1][0] + p[1] * mat[1][1] + p[2] * mat[1][2]; - Z = p[0] * mat[2][0] + p[1] * mat[2][1] + p[2] * mat[2][2]; + double X = p[0] * mat[0][0] + p[1] * mat[0][1] + p[2] * mat[0][2]; + double Y = p[0] * mat[1][0] + p[1] * mat[1][1] + p[2] * mat[1][2]; + double Z = p[0] * mat[2][0] + p[1] * mat[2][1] + p[2] * mat[2][2]; p[0] = X; p[1] = Y; p[2] = Z; @@ -127,9 +125,10 @@ ExtrudeParams::ExtrusionElementMap::ExtrusionElementMap(ExtrudeParams*const pare _parent = parent; } -std::vector< MElement* >* ExtrudeParams::ExtrusionElementMap::getExtrudedElems(MElement* source) +std::vector<MElement*>* ExtrudeParams:: +ExtrusionElementMap::getExtrudedElems(MElement* source) { - std::map<MElement*,std::vector<MElement*> >::iterator it = _extrudedElements.find(source); + std::map<MElement*, std::vector<MElement*> >::iterator it = _extrudedElements.find(source); if(it != _extrudedElements.end()) return &(it->second); return NULL; @@ -144,7 +143,8 @@ bool ExtrudeParams::ExtrusionElementMap::empty() return _extrudedElements.empty(); } -void ExtrudeParams::ExtrusionElementMap::addExtrudedElem(MElement* source, MElement* extrudedElem) +void ExtrudeParams:: +ExtrusionElementMap::addExtrudedElem(MElement* source, MElement* extrudedElem) { std::map<MElement*,std::vector<MElement*> >::iterator it = _extrudedElements.find(source); if(it != _extrudedElements.end()) @@ -159,37 +159,31 @@ void ExtrudeParams::ExtrusionElementMap::addExtrudedElem(MElement* source, MElem _extrudedElements.insert(std::pair<MElement*,std::vector<MElement*> >(source,*vec)); } SPoint3 np = extrudedElem->barycenter(), sp = source->barycenter(); -// if(extrudedElem->getDim() == 3) -// printf("Inst (%.3f,%.3f,%.3f) -> (%.3f,%.3f,%.3f) %p->%p\n",sp.x(),sp.y(),sp.z(),np.x(),np.y(),np.z(),source,extrudedElem); } -// Propagates the partition information from the source elements to the extruded elements. -// Increments the partition sizes if partitionSizes is given as argument. -// For efficient looping, this routine is within ExtrusionElementMap class. -void ExtrudeParams::ExtrusionElementMap::propagatePartitionInformation(std::vector< int >* partitionSizes) +// Propagates the partition information from the source elements to +// the extruded elements. Increments the partition sizes if +// partitionSizes is given as argument. For efficient looping, this +// routine is within ExtrusionElementMap class. +void ExtrudeParams:: +ExtrusionElementMap::propagatePartitionInformation(std::vector<int> *partitionSizes) { if (_extrudedElements.empty()) Msg::Error("No extrusion information found!"); std::map<MElement*,std::vector<MElement*> >::iterator columnit; - for(columnit=_extrudedElements.begin(); columnit != _extrudedElements.end(); columnit++) { + for(columnit=_extrudedElements.begin(); columnit != _extrudedElements.end(); + columnit++) { MElement* sourceElem = (*columnit).first; if(!sourceElem) { Msg::Warning("No source found!"); continue; } std::vector<MElement*> extrudedElements = (*columnit).second; -// if(!extrudedElements) { -// // Msg::Warning("No element vector found!"); -// continue; -// } for(unsigned int iE = 0;iE < extrudedElements.size();iE++) { if(extrudedElements[iE]) { extrudedElements[iE]->setPartition(sourceElem->getPartition()); if (partitionSizes) ++(*partitionSizes)[sourceElem->getPartition()-1]; -// SPoint3 np = extrudedElements[iE]->barycenter(), sp = sourceElem->barycenter(); -// if(extrudedElements[iE]->getDim() == 3) -// printf("Read (%.3f,%.3f,%.3f) %d -> (%.3f,%.3f,%.3f) %d %p->%p\n",sp.x(),sp.y(),sp.z(),extrudedElements[iE]->getPartition() ,np.x(),np.y(),np.z(),sourceElem->getPartition(),sourceElem,extrudedElements[iE]); } } } diff --git a/Geo/ExtrudeParams.h b/Geo/ExtrudeParams.h index ce6c344f0437f97121a0a4d27bde4f46f1cd2cff..b1dcf3a720ce7e385436e9ae6507ec438f80d43e 100644 --- a/Geo/ExtrudeParams.h +++ b/Geo/ExtrudeParams.h @@ -25,17 +25,17 @@ class ExtrudeParams{ public : class ExtrusionElementMap { - private: - ExtrudeParams* _parent; - // maps source element to all extruded elements - std::map<MElement*,std::vector<MElement*> > _extrudedElements; - public: - ExtrusionElementMap(ExtrudeParams* const parent); - std::vector<MElement*>* getExtrudedElems(MElement* source); - void addExtrudedElem(MElement* source,MElement* extrudedElem); - void clear(); - bool empty(); - void propagatePartitionInformation(std::vector<int>* partitionSizes = NULL); + private: + ExtrudeParams* _parent; + // maps source element to all extruded elements + std::map<MElement*,std::vector<MElement*> > _extrudedElements; + public: + ExtrusionElementMap(ExtrudeParams* const parent); + std::vector<MElement*>* getExtrudedElems(MElement* source); + void addExtrudedElem(MElement* source,MElement* extrudedElem); + void clear(); + bool empty(); + void propagatePartitionInformation(std::vector<int>* partitionSizes = NULL); } elementMap; static smooth_data *normals; ExtrudeParams(int Mode = EXTRUDED_ENTITY); diff --git a/Geo/Geo.h b/Geo/Geo.h index f4613af3323f81359710072987aeaf963fbaec13..6bfc4abd2242fa2233b645066bff4cf3dccdd7f8 100644 --- a/Geo/Geo.h +++ b/Geo/Geo.h @@ -148,7 +148,8 @@ class Surface{ int Method; int Recombine; int Recombine_Dir; // -1 is left, +1 is right, 0 is alternated - int TypeOfMapping; // +1 is harmonic, -1 is conformal, +2 harmonic_NoSplit , -2 conformal_NoSplit + int TypeOfMapping; // +1 is harmonic, -1 is conformal, +2 harmonic_NoSplit, + // -2 conformal_NoSplit double RecombineAngle; int TransfiniteSmoothing; List_T *Generatrices; diff --git a/Geo/OCCFace.cpp b/Geo/OCCFace.cpp index 828a68059b9b4a925f4cbb868ea2ab4a2234ae69..10213ec43988054d659ea92ec255c6558eef7111 100644 --- a/Geo/OCCFace.cpp +++ b/Geo/OCCFace.cpp @@ -31,7 +31,6 @@ OCCFace::OCCFace(GModel *m, TopoDS_Face _s, int num) : GFace(m, num), s(_s) { - // printf("NEW OCC FACE %d\n",tag()); setup(); } @@ -95,7 +94,6 @@ void OCCFace::setup() umax += fabs(du) / 100.0; vmax += fabs(dv) / 100.0; occface = BRep_Tool::Surface(s); - // printf("size = %d\n",l_edges.size()); } Range<double> OCCFace::parBounds(int i) const diff --git a/Geo/OCCFace.h b/Geo/OCCFace.h index 7f5d057a86f84f089e29c013db6f7058fb8c7dbc..6a9227f5f5a2534795c07303b5e92bf2065e4010 100644 --- a/Geo/OCCFace.h +++ b/Geo/OCCFace.h @@ -26,12 +26,12 @@ class OCCFace : public GFace { void replaceEdgesInternal (std::list<GEdge*> &); void setup(); public: - //OCCFace(GModel *m, TopoDS_Face s, int num, TopTools_IndexedMapOfShape &emap); OCCFace(GModel *m, TopoDS_Face s, int num); virtual ~OCCFace(){} Range<double> parBounds(int i) const; virtual GPoint point(double par1, double par2) const; - virtual GPoint closestPoint(const SPoint3 & queryPoint, const double initialGuess[2]) const; + virtual GPoint closestPoint(const SPoint3 & queryPoint, + const double initialGuess[2]) const; virtual bool containsPoint(const SPoint3 &pt) const; virtual SVector3 normal(const SPoint2 ¶m) const; virtual Pair<SVector3,SVector3> firstDer(const SPoint2 ¶m) const; diff --git a/Geo/discreteEdge.cpp b/Geo/discreteEdge.cpp index a06f135058acee3ede4a3b3d177e1fc85f1b2200..05108fbac30ad055b265ff1cf80e7588e7097030 100644 --- a/Geo/discreteEdge.cpp +++ b/Geo/discreteEdge.cpp @@ -389,7 +389,6 @@ void discreteEdge::computeNormals () const // itn->second = SVector3(nx,ny,nz); // } // delete normals; - } void discreteEdge::getLocalParameter(const double &t, int &iLine, @@ -448,7 +447,7 @@ GPoint discreteEdge::point(double par) const b210 = (2*v1 + v2 -w12*n1)*0.333; b120 = (2*v2 + v1 -w21*n2)*0.333; -// //tagged PN trinagles (sigma=1) + // tagged PN trinagles (sigma=1) double theta = 0.0; SVector3 d1 = v1+.33*(1-theta)*(v2-v1); SVector3 d2 = v2+.33*(1-theta)*(v1-v2); diff --git a/Geo/discreteEdge.h b/Geo/discreteEdge.h index f1b5e46d62670a2552548ce7c1424b6a4ce956be..3177df7e404548ce3cf0334b1fe68c25715c7fad 100644 --- a/Geo/discreteEdge.h +++ b/Geo/discreteEdge.h @@ -14,8 +14,8 @@ class discreteEdge : public GEdge { protected: std::vector<double> _pars; std::vector<int> _orientation; - std::map<MVertex*,MLine*> boundv; - mutable std::map<MVertex*,SVector3, std::less<MVertex*> > _normals; + std::map<MVertex*, MLine*> boundv; + mutable std::map<MVertex*, SVector3, std::less<MVertex*> > _normals; bool createdTopo; public: discreteEdge(GModel *model, int num, GVertex *_v0, GVertex *_v1); @@ -25,8 +25,10 @@ class discreteEdge : public GEdge { virtual GPoint point(double p) const; virtual SVector3 firstDer(double par) const; virtual Range<double> parBounds(int) const; - void parametrize( std::map<GFace*, std::map<MVertex*, MVertex*, std::less<MVertex*> > > &face2Verts, - std::map<GRegion*, std::map<MVertex*, MVertex*, std::less<MVertex*> > > ®ion2Vert); + void parametrize(std::map<GFace*, std::map<MVertex*, MVertex*, + std::less<MVertex*> > > &face2Verts, + std::map<GRegion*, std::map<MVertex*, MVertex*, + std::less<MVertex*> > > ®ion2Vert); void orderMLines(); void setBoundVertices(); void createTopo(); diff --git a/Geo/gmshFace.h b/Geo/gmshFace.h index 56b794f3ca22bf425d167fa3e09c992372454b3f..ad6c31abc1dda87d7f9711adfe56b99cea7031bd 100644 --- a/Geo/gmshFace.h +++ b/Geo/gmshFace.h @@ -22,7 +22,8 @@ class gmshFace : public GFace { Range<double> parBounds(int i) const; void setModelEdges(std::list<GEdge*> &); virtual GPoint point(double par1, double par2) const; - virtual GPoint closestPoint(const SPoint3 &queryPoint, const double initialGuess[2]) const; + virtual GPoint closestPoint(const SPoint3 &queryPoint, + const double initialGuess[2]) const; virtual bool containsPoint(const SPoint3 &pt) const; virtual double getMetricEigenvalue(const SPoint2 &); virtual SVector3 normal(const SPoint2 ¶m) const;