mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-26 21:00:34 +05:00
* Made the OCC subsystem independent of STLParameters (stlparam)
* Added a new class OCCParameters to handle OCC specific parameters
This commit is contained in:
parent
eb742ce90a
commit
4fc9c40286
File diff suppressed because it is too large
Load Diff
@ -853,14 +853,17 @@ namespace netgen
|
||||
|
||||
|
||||
|
||||
facemeshstatus.DeleteAll();
|
||||
facemeshstatus.SetSize (fmap.Extent());
|
||||
facemeshstatus = 0;
|
||||
|
||||
// Philippose - 15/01/2009
|
||||
face_maxh.DeleteAll();
|
||||
face_maxh.SetSize (fmap.Extent());
|
||||
face_maxh = mparam.maxh;
|
||||
|
||||
// Philippose - 17/01/2009
|
||||
face_sel_status.DeleteAll();
|
||||
face_sel_status.SetSize (fmap.Extent());
|
||||
face_sel_status = 0;
|
||||
|
||||
@ -1614,6 +1617,30 @@ namespace netgen
|
||||
return * new OCCRefinementSurfaces (*this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
OCCParameters :: OCCParameters()
|
||||
{
|
||||
resthcloseedgefac = 1;
|
||||
resthcloseedgeenable = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void OCCParameters :: Print(ostream & ost) const
|
||||
{
|
||||
ost << "OCC Parameters:" << endl
|
||||
<< "close edges: " << resthcloseedgeenable
|
||||
<< ", fac = " << resthcloseedgefac << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
OCCParameters occparam;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -119,6 +119,12 @@ namespace netgen
|
||||
#define ENTITYISHIGHLIGHTED 2
|
||||
#define ENTITYISDRAWABLE 4
|
||||
|
||||
#define OCCGEOMETRYVISUALIZATIONNOCHANGE 0
|
||||
#define OCCGEOMETRYVISUALIZATIONFULLCHANGE 1 // Compute transformation matrices and redraw
|
||||
#define OCCGEOMETRYVISUALIZATIONHALFCHANGE 2 // Redraw
|
||||
|
||||
|
||||
|
||||
class EntityVisualizationCode
|
||||
{
|
||||
int code;
|
||||
@ -156,6 +162,9 @@ namespace netgen
|
||||
{ code &= ~ENTITYISDRAWABLE;}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
inline double Det3 (double a00, double a01, double a02,
|
||||
double a10, double a11, double a12,
|
||||
double a20, double a21, double a22)
|
||||
@ -163,13 +172,10 @@ namespace netgen
|
||||
return a00*a11*a22 + a01*a12*a20 + a10*a21*a02 - a20*a11*a02 - a10*a01*a22 - a21*a12*a00;
|
||||
}
|
||||
|
||||
#define OCCGEOMETRYVISUALIZATIONNOCHANGE 0
|
||||
#define OCCGEOMETRYVISUALIZATIONFULLCHANGE 1
|
||||
// == compute transformation matrices and redraw
|
||||
#define OCCGEOMETRYVISUALIZATIONHALFCHANGE 2
|
||||
// == redraw
|
||||
|
||||
class OCCGeometry : public NetgenGeometry
|
||||
|
||||
|
||||
class OCCGeometry : public NetgenGeometry
|
||||
{
|
||||
Point<3> center;
|
||||
|
||||
@ -337,18 +343,49 @@ namespace netgen
|
||||
|
||||
void WriteOCC_STL(char * filename);
|
||||
|
||||
virtual int GenerateMesh (Mesh*& mesh,
|
||||
int perfstepsstart, int perfstepsend, char* optstring);
|
||||
|
||||
virtual const Refinement & GetRefinement () const;
|
||||
virtual int GenerateMesh (Mesh*& mesh,
|
||||
int perfstepsstart, int perfstepsend, char* optstring);
|
||||
|
||||
virtual const Refinement & GetRefinement () const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class OCCParameters
|
||||
{
|
||||
public:
|
||||
|
||||
/// Factor for meshing close edges
|
||||
double resthcloseedgefac;
|
||||
|
||||
|
||||
/// Enable / Disable detection of close edges
|
||||
int resthcloseedgeenable;
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
Default Constructor for the OpenCascade
|
||||
Mesh generation parameter set
|
||||
*/
|
||||
OCCParameters();
|
||||
|
||||
|
||||
/*!
|
||||
Dump all the OpenCascade specific meshing parameters
|
||||
to console
|
||||
*/
|
||||
void Print (ostream & ost) const;
|
||||
};
|
||||
|
||||
|
||||
void PrintContents (OCCGeometry * geom);
|
||||
|
||||
OCCGeometry * LoadOCC_IGES (const char * filename);
|
||||
OCCGeometry * LoadOCC_STEP (const char * filename);
|
||||
OCCGeometry * LoadOCC_BREP (const char * filename);
|
||||
|
||||
extern OCCParameters occparam;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
33
ng/ngpkg.cpp
33
ng/ngpkg.cpp
@ -2051,6 +2051,24 @@ namespace netgen
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef OCCGEOMETRY
|
||||
int Ng_SetOCCParameters (ClientData clientData,
|
||||
Tcl_Interp * interp,
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
occparam.resthcloseedgefac =
|
||||
atof (Tcl_GetVar (interp, "::stloptions.resthcloseedgefac", 0));
|
||||
|
||||
occparam.resthcloseedgeenable =
|
||||
atoi (Tcl_GetVar (interp, "::stloptions.resthcloseedgeenable", 0));
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
#endif // OCCGEOMETRY
|
||||
|
||||
|
||||
|
||||
int Ng_GetCommandLineParameter (ClientData clientData,
|
||||
Tcl_Interp * interp,
|
||||
int argc, tcl_const char *argv[])
|
||||
@ -2200,6 +2218,11 @@ namespace netgen
|
||||
multithread.terminate = 0;
|
||||
|
||||
Ng_SetSTLParameters (clientData, interp, 0, argv);
|
||||
|
||||
#ifdef OCCGEOMETRY
|
||||
Ng_SetOCCParameters (clientData, interp, 0, argv);
|
||||
#endif // OCCGEOMETRY
|
||||
|
||||
Ng_SetMeshingParameters (clientData, interp, 0, argv);
|
||||
|
||||
perfstepsstart = 1;
|
||||
@ -3003,6 +3026,11 @@ namespace netgen
|
||||
{
|
||||
|
||||
Ng_SetSTLParameters (clientData, interp, argc, argv);
|
||||
|
||||
#ifdef OCCGEOMETRY
|
||||
Ng_SetOCCParameters (clientData, interp, argc, argv);
|
||||
#endif // OCCGEOMETRY
|
||||
|
||||
Ng_SetMeshingParameters (clientData, interp, argc, argv);
|
||||
|
||||
if (mesh.Ptr() && stlgeometry)
|
||||
@ -5011,6 +5039,11 @@ namespace netgen
|
||||
(ClientData)NULL,
|
||||
(Tcl_CmdDeleteProc*) NULL);
|
||||
|
||||
#ifdef OCCGEOMETRY
|
||||
Tcl_CreateCommand (interp, "Ng_SetOCCParameters", Ng_SetOCCParameters,
|
||||
(ClientData)NULL,
|
||||
(Tcl_CmdDeleteProc*) NULL);
|
||||
#endif //OCCGEOMETRY
|
||||
|
||||
|
||||
Tcl_CreateCommand (interp, "Ng_SelectSurface", Ng_SelectSurface,
|
||||
|
Loading…
Reference in New Issue
Block a user