From c8fd5623fce483a212443a29edd53c2f9b03c6fb Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 26 Sep 2008 12:04:30 +0000 Subject: [PATCH] *** empty log message *** --- src/VISU_I/VISU_ClippingPlaneMgr.cxx | 18 ++++++++ src/VISU_I/VISU_ClippingPlaneMgr.hxx | 3 ++ src/VISU_I/VISU_DumpPython.cc | 65 +++++++++++++++++++++++++++- 3 files changed, 85 insertions(+), 1 deletion(-) diff --git a/src/VISU_I/VISU_ClippingPlaneMgr.cxx b/src/VISU_I/VISU_ClippingPlaneMgr.cxx index bcdf285e..f314d418 100644 --- a/src/VISU_I/VISU_ClippingPlaneMgr.cxx +++ b/src/VISU_I/VISU_ClippingPlaneMgr.cxx @@ -251,6 +251,24 @@ VISU_CutPlaneFunction* VISU_ClippingPlaneMgr::GetClippingPlane(long id) return NULL; return (VISU_CutPlaneFunction*) myPlanes->GetItemAsObject(id); } + +//************************************************************* + /* Returns -1 if Plane is not exists */ +int VISU_ClippingPlaneMgr::GetPlaneId(VISU_CutPlaneFunction* thePlane) +{ + int aTag = thePlane->getPlaneObject()->Tag(); + int aRes = -1; + VISU_CutPlaneFunction* aPlane; + for (int i = 0; i < GetClippingPlanesNb(); i++) { + aPlane = GetClippingPlane(i); + if (aPlane->getPlaneObject()->Tag() == aTag) { + aRes = i; + break; + } + } + return aRes; +} + //************************************************************* /* Deletes clipping plane by its Id */ diff --git a/src/VISU_I/VISU_ClippingPlaneMgr.hxx b/src/VISU_I/VISU_ClippingPlaneMgr.hxx index c71e3d98..78d5cf5a 100644 --- a/src/VISU_I/VISU_ClippingPlaneMgr.hxx +++ b/src/VISU_I/VISU_ClippingPlaneMgr.hxx @@ -97,6 +97,9 @@ public: /* Returns clipping plane by its Id */ VISU_CutPlaneFunction* GetClippingPlane(long id); + + /* Returns -1 if Plane is not exists */ + int GetPlaneId(VISU_CutPlaneFunction* thePlane); /* Deletes clipping plane by its Id */ bool DeleteClippingPlane(long id); diff --git a/src/VISU_I/VISU_DumpPython.cc b/src/VISU_I/VISU_DumpPython.cc index 6b07b81b..3fceafc5 100644 --- a/src/VISU_I/VISU_DumpPython.cc +++ b/src/VISU_I/VISU_DumpPython.cc @@ -178,6 +178,28 @@ namespace VISU //--------------------------------------------------------------------------- + void SetClippingPlane(Prs3d_i* thePrs, string theName, + std::ostream& theStr, + std::string thePrefix) + { + VISU_CutPlaneFunction* aPlane; + VISU_Gen_i* aGen = VISU_Gen_i::GetVisuGenImpl(); + VISU_ClippingPlaneMgr& aMgr = aGen->GetClippingPlaneMgr(); + int aId; + for (int i = 0; i < thePrs->GetNumberOfClippingPlanes(); i++) { + aPlane = dynamic_cast(thePrs->GetClippingPlane(i)); + if (aPlane) { + if (!aPlane->isAuto()) { + aId = aMgr.GetPlaneId(aPlane); + if (aId > -1) { + theStr<GetOffset(x,y,z); theStr<GetOrigin(aOrigin); + aPlane->GetNormal(aDir); + + theStr<isAuto()<<",\""<getName()<<"\")"<GetDefaultScript("Post-Pro", aPrefix.c_str()); -- 2.39.2