mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
shared pointer
This commit is contained in:
parent
7892d0eeec
commit
9805ec973a
@ -18,8 +18,8 @@ extern "C" int Ng_CSG_Init (Tcl_Interp * interp);
|
||||
namespace netgen
|
||||
{
|
||||
// extern DLL_HEADER NetgenGeometry * ng_geometry;
|
||||
extern DLL_HEADER AutoPtr<NetgenGeometry> ng_geometry;
|
||||
extern DLL_HEADER AutoPtr<Mesh> mesh;
|
||||
extern DLL_HEADER shared_ptr<NetgenGeometry> ng_geometry;
|
||||
extern DLL_HEADER shared_ptr<Mesh> mesh;
|
||||
|
||||
static VisualSceneGeometry vsgeom;
|
||||
|
||||
@ -34,7 +34,7 @@ namespace netgen
|
||||
Tcl_Interp * interp,
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
CSGeometry * csgeom = dynamic_cast<CSGeometry*> (ng_geometry.Ptr());
|
||||
CSGeometry * csgeom = dynamic_cast<CSGeometry*> (ng_geometry.get());
|
||||
if (csgeom)
|
||||
{
|
||||
double detail = atof (Tcl_GetVar (interp, "::geooptions.detail", 0));
|
||||
@ -53,7 +53,7 @@ namespace netgen
|
||||
Tcl_Interp * interp,
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.Ptr());
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.get());
|
||||
|
||||
|
||||
const char * command = argv[1];
|
||||
@ -108,7 +108,7 @@ namespace netgen
|
||||
Tcl_Interp * interp,
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.Ptr());
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.get());
|
||||
if (!geometry)
|
||||
{
|
||||
Tcl_SetResult (interp, err_needscsgeometry, TCL_STATIC);
|
||||
@ -143,7 +143,7 @@ namespace netgen
|
||||
Tcl_Interp * interp,
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.Ptr());
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.get());
|
||||
if (!geometry)
|
||||
{
|
||||
Tcl_SetResult (interp, err_needscsgeometry, TCL_STATIC);
|
||||
@ -181,7 +181,7 @@ namespace netgen
|
||||
Tcl_Interp * interp,
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.Ptr());
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.get());
|
||||
if (!geometry)
|
||||
{
|
||||
Tcl_SetResult (interp, err_needscsgeometry, TCL_STATIC);
|
||||
@ -208,7 +208,7 @@ namespace netgen
|
||||
Tcl_Interp * interp,
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.Ptr());
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.get());
|
||||
if (!geometry)
|
||||
{
|
||||
Tcl_SetResult (interp, err_needscsgeometry, TCL_STATIC);
|
||||
@ -246,7 +246,7 @@ namespace netgen
|
||||
Tcl_Interp * interp,
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.Ptr());
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.get());
|
||||
if (!geometry)
|
||||
{
|
||||
Tcl_SetResult (interp, err_needscsgeometry, TCL_STATIC);
|
||||
@ -273,7 +273,7 @@ namespace netgen
|
||||
Tcl_Interp * interp,
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.Ptr());
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.get());
|
||||
if (!geometry)
|
||||
{
|
||||
Tcl_SetResult (interp, err_needscsgeometry, TCL_STATIC);
|
||||
@ -306,7 +306,7 @@ namespace netgen
|
||||
Tcl_Interp * interp,
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.Ptr());
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.get());
|
||||
if (!geometry)
|
||||
{
|
||||
Tcl_SetResult (interp, err_needscsgeometry, TCL_STATIC);
|
||||
@ -337,7 +337,7 @@ namespace netgen
|
||||
Tcl_Interp * interp,
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.Ptr());
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.get());
|
||||
if (!geometry)
|
||||
{
|
||||
Tcl_SetResult (interp, err_needscsgeometry, TCL_STATIC);
|
||||
@ -368,7 +368,7 @@ namespace netgen
|
||||
Tcl_Interp * interp,
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.Ptr());
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.get());
|
||||
if (!geometry)
|
||||
{
|
||||
Tcl_SetResult (interp, err_needscsgeometry, TCL_STATIC);
|
||||
@ -493,14 +493,14 @@ namespace netgen
|
||||
Tcl_Interp * interp,
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.Ptr());
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.get());
|
||||
if (!geometry)
|
||||
{
|
||||
Tcl_SetResult (interp, err_needscsgeometry, TCL_STATIC);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (!mesh.Ptr())
|
||||
if (!mesh)
|
||||
{
|
||||
Tcl_SetResult (interp, err_needsmesh, TCL_STATIC);
|
||||
return TCL_ERROR;
|
||||
@ -522,7 +522,7 @@ namespace netgen
|
||||
Tcl_Interp * interp,
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.Ptr());
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.get());
|
||||
if (!geometry)
|
||||
{
|
||||
Tcl_SetResult (interp, err_needscsgeometry, TCL_STATIC);
|
||||
@ -611,7 +611,7 @@ namespace netgen
|
||||
|
||||
VisualScene * CSGeometryRegister :: GetVisualScene (const NetgenGeometry * geom) const
|
||||
{
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.Ptr());
|
||||
CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry.get());
|
||||
if (geometry)
|
||||
{
|
||||
vsgeom.SetGeometry (geometry);
|
||||
|
@ -19,8 +19,8 @@ extern "C" int Ng_STL_Init (Tcl_Interp * interp);
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
extern AutoPtr<NetgenGeometry> ng_geometry;
|
||||
extern AutoPtr<Mesh> mesh;
|
||||
extern shared_ptr<NetgenGeometry> ng_geometry;
|
||||
extern shared_ptr<Mesh> mesh;
|
||||
|
||||
static VisualSceneSTLGeometry vsstlgeom;
|
||||
static VisualSceneSTLMeshing vsstlmeshing;
|
||||
@ -122,7 +122,7 @@ namespace netgen
|
||||
{
|
||||
//cout << "STL doctor" << endl;
|
||||
STLGeometry * stlgeometry =
|
||||
dynamic_cast<STLGeometry*> (ng_geometry.Ptr());
|
||||
dynamic_cast<STLGeometry*> (ng_geometry.get());
|
||||
|
||||
|
||||
stldoctor.drawmeshededges =
|
||||
@ -418,7 +418,7 @@ namespace netgen
|
||||
double data[10];
|
||||
static char buf[20];
|
||||
|
||||
STLGeometry * stlgeometry = dynamic_cast<STLGeometry*> (ng_geometry.Ptr());
|
||||
STLGeometry * stlgeometry = dynamic_cast<STLGeometry*> (ng_geometry.get());
|
||||
|
||||
if (!stlgeometry)
|
||||
{
|
||||
@ -520,8 +520,8 @@ namespace netgen
|
||||
|
||||
Ng_SetMeshingParameters (clientData, interp, argc, argv);
|
||||
|
||||
STLGeometry * stlgeometry = dynamic_cast<STLGeometry*> (ng_geometry.Ptr());
|
||||
if (mesh.Ptr() && stlgeometry)
|
||||
STLGeometry * stlgeometry = dynamic_cast<STLGeometry*> (ng_geometry.get());
|
||||
if (mesh && stlgeometry)
|
||||
{
|
||||
mesh -> SetLocalH (stlgeometry->GetBoundingBox().PMin() - Vec3d(10, 10, 10),
|
||||
stlgeometry->GetBoundingBox().PMax() + Vec3d(10, 10, 10),
|
||||
|
Loading…
Reference in New Issue
Block a user