_remeshPara (harmonic),
_smouthSteps (1),
_sizeFactor (1),
- _maxSize (1e22),
_minSize (0),
+ _maxSize (1e22),
_secondOrder (false),
_useIncomplElem (true)
{
return load;
}
-ostream & operator <<(ostream & save, GMSHPlugin_Hypothesis & hyp)
-{
- return hyp.SaveTo( save );
-}
-
-istream & operator >>(istream & load, GMSHPlugin_Hypothesis & hyp)
-{
- return hyp.LoadFrom( load );
-}
-
-
//================================================================================
/*!
* \brief Does nothing
//================================================================================
bool GMSHPlugin_Hypothesis::SetParametersByDefaults(const TDefaults& dflts,
- const SMESH_Mesh* theMesh)
+ const SMESH_Mesh* theMesh)
{
//_nbSegPerEdge = dflts._nbSegments;
//_maxSize = dflts._elemLength;
// _minSize = GMSHPlugin_Mesher::GetDefaultMinSize( theMesh->GetShapeToMesh(), _maxSize );
//return _nbSegPerEdge && _maxSize > 0;
+ return false;
}
// Persistence
virtual ostream & SaveTo(ostream & save);
virtual istream & LoadFrom(istream & load);
- friend GMSHPLUGIN_EXPORT ostream & operator <<(ostream & save, GMSHPlugin_Hypothesis & hyp);
- friend GMSHPLUGIN_EXPORT istream & operator >>(istream & load, GMSHPlugin_Hypothesis & hyp);
/*!
* \brief Does nothing
}
return "";
}
+
+//================================================================================
+/*!
+ * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter
+ */
+//================================================================================
+
+bool
+GMSHPlugin_Hypothesis_i::getObjectsDependOn( std::vector< std::string > & entryArray,
+ std::vector< int > & subIDArray ) const
+{
+ typedef ::GMSHPlugin_Hypothesis THyp;
+ const THyp* impl = static_cast<const THyp*>( myBaseImpl );
+
+ const THyp::TCompound& compounds = impl->GetCompoundOnEntries();
+ entryArray.assign( compounds.cbegin(), compounds.cend() );
+
+ return true;
+}
+
+//================================================================================
+/*!
+ * \brief Set new geometry instead of that returned by getObjectsDependOn()
+ */
+//================================================================================
+
+bool
+GMSHPlugin_Hypothesis_i::setObjectsDependOn( std::vector< std::string > & entryArray,
+ std::vector< int > & subIDArray )
+{
+ typedef ::GMSHPlugin_Hypothesis THyp;
+ THyp* impl = static_cast< THyp* >( myBaseImpl );
+
+ size_t iEnt = 0;
+
+ THyp::TCompound& compoundsNew = const_cast< THyp::TCompound& > ( impl->GetCompoundOnEntries() );
+ THyp::TCompound compounds;
+ compounds.swap( compoundsNew );
+
+ THyp::TCompound::const_iterator entry = compounds.cbegin();
+ for ( ; entry != compounds.cend(); ++entry, ++iEnt )
+ if ( !entryArray[ iEnt ].empty() )
+ compoundsNew.insert( entryArray[ iEnt ]);
+
+ return true;
+}
void SetNbSegPerRadius(CORBA::Double theVal);
CORBA::Double GetNbSegPerRadius();
- void SetLocalSizeOnShape(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double localSize);
- void SetLocalSizeOnEntry(const char* entry, CORBA::Double localSize);
- CORBA::Double GetLocalSizeOnEntry(const char* entry);
- GMSHPlugin::string_array* GetLocalSizeEntries();
+ // void SetLocalSizeOnShape(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double localSize);
+ // void SetLocalSizeOnEntry(const char* entry, CORBA::Double localSize);
+ // CORBA::Double GetLocalSizeOnEntry(const char* entry);
+ // GMSHPlugin::string_array* GetLocalSizeEntries();
void UnsetLocalSizeOnEntry(const char* entry);
// into myMethod2VarParams. It should return a method name for an index of
// variable parameters. Index is countered from zero
virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;
+
+
+ // Methods for copying mesh definition to other geometry
+
+ // Return geometry this hypothesis depends on. Return false if there is no geometry parameter
+ virtual bool getObjectsDependOn( std::vector< std::string > & entryArray,
+ std::vector< int > & subIDArray ) const;
+
+ // Set new geometry instead of that returned by getObjectsDependOn()
+ virtual bool setObjectsDependOn( std::vector< std::string > & entryArray,
+ std::vector< int > & subIDArray );
};
#endif
geomShape = smeshGen_i->GeomObjectToShape( aGeomObj.in() );
TopAbs_ShapeEnum geomType = geomShape.ShapeType();
- if (geomShape.ShapeType() == TopAbs_COMPOUND)// voir s'il ne faut pas mettre une erreur dans le cas contraire
+ if ( geomType == TopAbs_COMPOUND)// voir s'il ne faut pas mettre une erreur dans le cas contraire
{
MESSAGE("shapeType == TopAbs_COMPOUND");
TopoDS_Iterator it(geomShape);
MESSAGE(" shapeType == TopAbs_EDGE :");
int num = _gModel->getNumEdges()+1;
Curve *curve = CreateCurve(num, MSH_SEGM_COMPOUND, 1, NULL, NULL, -1, -1, 0., 1.);
- for (it; it.More(); it.Next())
+ for ( ; it.More(); it.Next())
{
TopoDS_Shape topoShape = it.Value();
ASSERT(topoShape.ShapeType() == shapeType);
MESSAGE(" shapeType == TopAbs_FACE :");
int num = _gModel->getNumFaces()+1;
Surface *surface = CreateSurface(num, MSH_SURF_COMPOUND);
- for (it; it.More(); it.Next())
+ for ( ; it.More(); it.Next())
{
TopoDS_Shape topoShape = it.Value();
ASSERT(topoShape.ShapeType() == shapeType);
std::vector<MVertex*> verts;
e->getVertices(verts);
ASSERT(verts.size()==1);
- SMDS_Mesh0DElement* zeroDElement = 0;
+ //SMDS_Mesh0DElement* zeroDElement = 0;
// WE DONT ADD 0D ELEMENTS because it does not follow the salome meshers philosophy
//zeroDElement = meshDS->Add0DElementWithID(verts[0]->getNum(),e->getNum());
//meshDS->SetMeshElementOnShape(zeroDElement, topoVertex);
void CreateGmshCompounds();
void FillSMesh();
float DistBoundingBox(SBoundingBox3d& bounds,SPoint3& point);
-
+
class mymsg : public GmshMessage
{
- private:
- GModel* _gModel;
- public:
- mymsg(GModel* _gModel) : _gModel(_gModel), GmshMessage() {}
- void operator()(std::string level, std::string msg);
+ private:
+ GModel* _gModel;
+ public:
+ mymsg(GModel* _gModel) : GmshMessage(), _gModel(_gModel) {}
+ void operator()(std::string level, std::string msg);
};
};