Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _VISU_ClippingPlane_H_
00026 #define _VISU_ClippingPlane_H_
00027
00028 #include "VISU_I.hxx"
00029 #include "VISUConfig.hh"
00030 #include "SALOME_Component_i.hxx"
00031 #include "VISU_ColoredPrs3d_i.hh"
00032
00033 #include <vtkPlane.h>
00034 #include <string>
00035
00036 class vtkImplicitFunctionCollection;
00037
00038
00039 class VISU_I_EXPORT VISU_CutPlaneFunction: public vtkPlane
00040 {
00041 public:
00042 static VISU_CutPlaneFunction* New();
00043
00044 vtkTypeMacro(VISU_CutPlaneFunction, vtkPlane);
00045
00046 virtual double EvaluateFunction(double x[3]);
00047 virtual double EvaluateFunction(double x, double y, double z);
00048
00049 void setActive(bool theActive);
00050 bool isActive() const { return myIsActive; }
00051
00052 void setPlaneObject(_PTR(SObject) aSOPlane) { mySObject = aSOPlane; }
00053 _PTR(SObject) getPlaneObject() const { return mySObject; }
00054
00055 void setName(std::string theName) { myName = theName; }
00056 std::string getName() const { return myName; }
00057
00058 void setAuto(bool isAuto) { myIsAuto = isAuto; }
00059 bool isAuto() const { return myIsAuto; }
00060
00061 protected:
00062 VISU_CutPlaneFunction();
00063 ~VISU_CutPlaneFunction();
00064
00065 private:
00066 bool myIsActive;
00067 _PTR(SObject) mySObject;
00068 std::string myName;
00069 bool myIsAuto;
00070 };
00071
00072
00073
00074 class VISU_I_EXPORT VISU_ClippingPlaneMgr {
00075 public:
00076 VISU_ClippingPlaneMgr();
00077 ~VISU_ClippingPlaneMgr();
00078
00079 void SetStudy(_PTR(Study) theStudy, bool reinitStudy = false);
00080
00081
00082 long CreateClippingPlane(double X,double Y, double Z,
00083 double dX, double dY, double dZ,
00084 bool isAuto, const char* name);
00085
00086 void EditClippingPlane(long id, double X,double Y, double Z,
00087 double dX, double dY, double dZ,
00088 bool isAuto, const char* name);
00089
00090 _PTR(SObject) CreateClippingPlaneObject(double X,double Y, double Z,
00091 double dX, double dY, double dZ,
00092 bool isAuto, const char* name);
00093
00094
00095 VISU_CutPlaneFunction* GetClippingPlane(long id);
00096
00097
00098 int GetPlaneId(VISU_CutPlaneFunction* thePlane);
00099
00100
00101 bool DeleteClippingPlane(long id);
00102
00103
00104 bool ApplyClippingPlane(VISU::Prs3d_i* thePrs, long id);
00105
00106 bool DetachClippingPlane(VISU::Prs3d_i* thePrs, long id);
00107
00108
00109 long GetClippingPlanesNb();
00110
00111 _PTR(SObject) GetClippingPlanesFolder(bool toCreate);
00112
00113 static bool ContainsPlane(VISU::Prs3d_ptr thePrs, VISU_CutPlaneFunction* thePlane);
00114 static bool ContainsPlane(VISU::Prs3d_i* thePrs, VISU_CutPlaneFunction* thePlane);
00115
00116 vtkImplicitFunctionCollection* GetPlanesList() const { return myPlanes; }
00117
00118
00119 private:
00120 void applyPlaneToAll(VISU_CutPlaneFunction* thePlane);
00121
00122
00123 _PTR(Study) myStudy;
00124
00125 vtkImplicitFunctionCollection* myPlanes;
00126 };
00127
00128 #endif