2 #include "VISU_Plot3D_i.hh"
4 #include "VISU_Result_i.hh"
6 #include "VISU_Plot3DPL.hxx"
8 #include "VISU_Actor.h"
14 static int MYDEBUG = 0;
16 static int MYDEBUG = 0;
19 int VISU::Plot3D_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
20 const char* theFieldName, int theIteration, int isMemoryCheck)
22 return VISU::ScalarMap_i::IsPossible
23 (theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
26 int VISU::Plot3D_i::myNbPresent = 0;
27 QString VISU::Plot3D_i::GenerateName() { return VISU::GenerateName("Plot3D",myNbPresent++); }
29 const string VISU::Plot3D_i::myComment = "PLOT3D";
30 const char* VISU::Plot3D_i::GetComment() const { return myComment.c_str(); }
32 VISU::Plot3D_i::Plot3D_i (Result_i* theResult, bool theAddToStudy)
33 : PrsObject_i(theResult->GetStudyDocument()),
34 Prs3d_i(theResult,theAddToStudy),
35 ScalarMap_i(theResult,theAddToStudy),
40 VISU::Plot3D_i::Plot3D_i (Result_i* theResult, SALOMEDS::SObject_ptr theSObject)
41 : PrsObject_i(theResult->GetStudyDocument()),
42 Prs3d_i(theResult,theSObject),
43 ScalarMap_i(theResult,theSObject),
48 void VISU::Plot3D_i::SameAs (const Plot3D_i* theOrigin)
50 VISU::ScalarMap_i::SameAs(theOrigin);
53 VISU::Storable* VISU::Plot3D_i::Create (const char* theMeshName, VISU::Entity theEntity,
54 const char* theFieldName, int theIteration)
56 return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
59 VISU::Storable* VISU::Plot3D_i::Restore (const Storable::TRestoringMap& theMap)
62 SetOrientation(VISU::Plot3D::Orientation(VISU::Storable::FindValue(theMap,"myBasePlane").toInt()),
63 Storable::FindValue(theMap,"aRot[0]").toDouble(),
64 Storable::FindValue(theMap,"aRot[1]").toDouble());
65 SetPlanePosition(VISU::Storable::FindValue(theMap,"myPlanePosition").toDouble(),
66 VISU::Storable::FindValue(theMap,"myPlaneCondition").toInt());
67 SetScaleFactor(VISU::Storable::FindValue(theMap,"myScaleFactor").toDouble());
68 SetContourPrs(VISU::Storable::FindValue(theMap,"myContourPrs").toInt());
69 SetNbOfContours(VISU::Storable::FindValue(theMap,"myNbOfContours").toInt());
71 return ScalarMap_i::Restore(theMap);
74 void VISU::Plot3D_i::ToStream (std::ostringstream& theStr)
76 ScalarMap_i::ToStream(theStr);
78 Storable::DataToStream(theStr, "myBasePlane", int(GetOrientationType()));
79 Storable::DataToStream(theStr, "aRot[0]", GetRotateX());
80 Storable::DataToStream(theStr, "aRot[1]", GetRotateY());
81 Storable::DataToStream(theStr, "myPlanePosition", GetPlanePosition());
82 Storable::DataToStream(theStr, "myPlaneCondition", int(IsPositionRelative()));
83 Storable::DataToStream(theStr, "myScaleFactor", GetScaleFactor());
84 Storable::DataToStream(theStr, "myContourPrs", int(GetIsContourPrs()));
85 Storable::DataToStream(theStr, "myNbOfContours", int(GetNbOfContours()));
88 VISU::Plot3D_i::~Plot3D_i(){
89 if(MYDEBUG) MESSAGE("Plot3D_i::~Plot3D_i()");
92 void VISU::Plot3D_i::SetOrientation (VISU::Plot3D::Orientation theOrient,
93 CORBA::Double theXAngle, CORBA::Double theYAngle)
95 myPlot3DPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
99 VISU::Plot3D::Orientation VISU::Plot3D_i::GetOrientationType()
101 return VISU::Plot3D::Orientation(myPlot3DPL->GetPlaneOrientation());
104 CORBA::Double VISU::Plot3D_i::GetRotateX()
106 return myPlot3DPL->GetRotateX();
109 CORBA::Double VISU::Plot3D_i::GetRotateY()
111 return myPlot3DPL->GetRotateY();
114 void VISU::Plot3D_i::SetPlanePosition (CORBA::Double thePlanePosition,
115 CORBA::Boolean theIsRelative)
117 myPlot3DPL->SetPlanePosition(thePlanePosition, theIsRelative);
120 CORBA::Double VISU::Plot3D_i::GetPlanePosition()
122 return myPlot3DPL->GetPlanePosition();
125 CORBA::Boolean VISU::Plot3D_i::IsPositionRelative()
127 return myPlot3DPL->IsPositionRelative();
130 void VISU::Plot3D_i::SetScaleFactor (CORBA::Double theScaleFactor)
132 myPlot3DPL->SetScaleFactor(theScaleFactor);
135 CORBA::Double VISU::Plot3D_i::GetScaleFactor()
137 return myPlot3DPL->GetScaleFactor();
140 void VISU::Plot3D_i::SetNbOfContours (CORBA::Long theNb)
142 myPlot3DPL->SetNumberOfContours(theNb);
145 CORBA::Long VISU::Plot3D_i::GetNbOfContours()
147 return myPlot3DPL->GetNumberOfContours();
150 void VISU::Plot3D_i::SetContourPrs (CORBA::Boolean theIsContourPrs )
152 myPlot3DPL->SetContourPrs( theIsContourPrs );
155 CORBA::Boolean VISU::Plot3D_i::GetIsContourPrs()
157 return myPlot3DPL->GetIsContourPrs();
160 void VISU::Plot3D_i::DoHook()
162 if (!myPipeLine) myPipeLine = VISU_Plot3DPL::New();
163 myPlot3DPL = dynamic_cast<VISU_Plot3DPL*>(myPipeLine);
165 ScalarMap_i::DoHook();
168 void VISU::Plot3D_i::SetMapScale(double theMapScale)
170 myPlot3DPL->SetMapScale(theMapScale);