]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Implementation of InteractorObserver functionality for the GaussPoints Actor class
authorapo <apo@opencascade.com>
Thu, 22 Sep 2005 05:58:33 +0000 (05:58 +0000)
committerapo <apo@opencascade.com>
Thu, 22 Sep 2005 05:58:33 +0000 (05:58 +0000)
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_GaussPoints_i.hh
src/VISU_I/VISU_Prs3d_i.cc
src/VISU_I/VISU_Prs3d_i.hh

index 7fa87b1de4a34087064ea2b31fde1a66a4371475..abd082fbc0a2e7ddcb54c008194b2266d632143a 100644 (file)
@@ -33,7 +33,7 @@ using namespace VISU;
 using namespace std;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
 #else
 static int MYDEBUG = 0;
 #endif
@@ -146,6 +146,43 @@ VISU::GaussPoints_i
 }
 
 
+//----------------------------------------------------------------------------
+VISU_GaussPointsPL* 
+VISU::GaussPoints_i
+::GetGaussPointsPL()
+{ 
+  return myGaussPointsPL; 
+}
+
+QColor
+VISU::GaussPoints_i
+::GetColor() 
+{ 
+  return myColor;
+}
+
+void
+VISU::GaussPoints_i
+::SetColor( const QColor& theColor ) 
+{ 
+  myColor = theColor; 
+}
+
+bool
+VISU::GaussPoints_i
+::IsColored() 
+{ 
+  return myIsColored; 
+}
+
+void
+VISU::GaussPoints_i
+::ShowColored( bool theColored )
+{
+  myIsColored = theColored; 
+}
+
+
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
@@ -188,10 +225,7 @@ VISU_PipeLine*
 VISU::GaussPoints_i
 ::GetPipeLine()
 {
-  VISU_GaussPointsPL* aPipeLine = VISU_GaussPointsPL::New();
-  aPipeLine->ShallowCopy(myPipeLine);
-  aPipeLine->Update();
-  return aPipeLine;
+  return GetPL();
 }
 
 
@@ -213,6 +247,13 @@ VISU::GaussPoints_i
   return anActor;
 }
 
+//----------------------------------------------------------------------------
+VISU_Actor* 
+VISU::GaussPoints_i
+::CloneActor(VISU_Actor* theActor) 
+{
+  VISU::ScalarMap_i::CloneActor(theActor);
+}
 
 //----------------------------------------------------------------------------
 void 
@@ -235,23 +276,26 @@ VISU::GaussPoints_i
   }
 }
 
-
 //----------------------------------------------------------------------------
-VISU_Actor* 
+void
 VISU::GaussPoints_i
-::CloneActor(VISU_Actor* theActor) 
+::UpdateFromActor(VISU_Actor* theActor) 
 {
-  VISU::ScalarMap_i::CloneActor(theActor);
+  if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
+    bool aChangeMagnification = anActor->ChangeMagnification();
+    if(MYDEBUG) MESSAGE("GaussPoints_i::UpdateFromActor - this = "<<this<<
+                       "; aChangeMagnification = "<<aChangeMagnification);
+    myGaussPointsPL->ChangeMagnification(aChangeMagnification);
+  }
+  VISU::Prs3d_i::UpdateFromActor(theActor);
 }
 
-
 //----------------------------------------------------------------------------
 void 
 VISU::GaussPoints_i
 ::SetImplicitFunction(VISU_Actor* theActor, 
                      vtkImplicitFunction* theImplicitFunction)
 {
-  //VISU::ScalarMap_i::SetImplicitFunction(theActor,theImplicitFunction);
   if(VISU_PipeLine* aPipeLine = theActor->GetPipeLine())
     aPipeLine->SetImplicitFunction(theImplicitFunction);
 }
index 67d4427ce4dca27286dfd505b56450174401cd70..0df0a89824bd632819091c4195a7604c65c7b29e 100644 (file)
@@ -53,25 +53,37 @@ namespace VISU
 
     typedef VISU::GaussPoints TInterface;
 
-    VISU_GaussPointsPL* GetGaussPointsPL(){ return myGaussPointsPL; }
+    VISU_GaussPointsPL* 
+    GetGaussPointsPL();
 
-    QColor GetColor() { return myColor;}
-    void SetColor( const QColor& theColor ) { myColor = theColor; }
+    QColor
+    GetColor();
 
-    bool IsColored() { return myIsColored; }
-    void ShowColored( bool theColored ) { myIsColored = theColored; }
+    void
+    SetColor( const QColor& theColor );
+
+    bool 
+    IsColored();
+
+    void
+    ShowColored( bool theColored );
 
   protected:
-    virtual void DoSetInput(Result_i* theResult);
-    virtual void DoHook();
+    virtual
+    void
+    DoSetInput(Result_i* theResult);
+
+    virtual
+    void
+    DoHook();
 
     virtual 
     VISU_PipeLine* 
     GetPipeLine();
 
     VISU_GaussPointsPL *myGaussPointsPL;
-    QColor myColor;
     bool myIsColored;
+    QColor myColor;
 
   public:
     static 
@@ -112,13 +124,17 @@ namespace VISU
     VISU_Actor* 
     CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
 
+    virtual 
+    VISU_Actor* 
+    CloneActor(VISU_Actor* theActor);
+
     virtual
     void
     UpdateActor(VISU_Actor* theActor);
 
     virtual 
-    VISU_Actor* 
-    CloneActor(VISU_Actor* theActor);
+    void
+    UpdateFromActor(VISU_Actor* theActor);
 
     //----------------------------------------------------------------------------
     virtual 
index f59c88d36d7b52b9893d98fc2723630fff3bb953..bf37395c361aa8099bae37bdff0a56a758b46a1f 100644 (file)
@@ -148,7 +148,7 @@ void
 VISU::Prs3d_i
 ::Update() 
 {
-  if(MYDEBUG) MESSAGE("Prs3d_i::Update() - this = "<<this);
+  if(MYDEBUG) MESSAGE("Prs3d_i::Update - this = "<<this);
   try{
     myPipeLine->Update();
   }catch(...){
@@ -206,30 +206,38 @@ VISU::Prs3d_i
   }
 }
 
+VISU_Actor*
+VISU::Prs3d_i
+::CloneActor(VISU_Actor* theActor)
+{
+  VISU_Actor* anActor = CreateActor();
+  theActor->Connect(anActor);
+  return anActor;
+}
+
 void
 VISU::Prs3d_i
 ::UpdateActor(VISU_Actor* theActor) 
 {
-  if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor() - this = "<<this);
+  if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor - this = "<<this);
   theActor->GetMapper()->ShallowCopy(myPipeLine->GetMapper());
   theActor->SetPosition(myOffset);
   theActor->Modified();
 }
 
-VISU_Actor*
+void
 VISU::Prs3d_i
-::CloneActor(VISU_Actor* theActor)
+::UpdateFromActor(VISU_Actor* theActor) 
 {
-  VISU_Actor* anActor = CreateActor();
-  theActor->Connect(anActor);
-  return anActor;
+  if(MYDEBUG) MESSAGE("Prs3d_i::UpdateFromActor - this = "<<this);
+  UpdateActors();
 }
 
 void
 VISU::Prs3d_i
-::UpdateActors() 
+::UpdateActors()
 {
-  if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActors() - this = "<<this);
+  if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActors - this = "<<this);
   Update();
   myUpdateActorsSignal();
 }
index ca444d7e3861c41bca10f50fd9497b0fc17bb4c1..1d8d679224341c1f05ea2bb909ae1e4a7a8c1760 100644 (file)
@@ -138,13 +138,17 @@ namespace VISU
     VISU_Actor* 
     CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL) = 0;
 
+    virtual 
+    VISU_Actor* 
+    CloneActor(VISU_Actor* theActor);
+
     virtual 
     void
     UpdateActor(VISU_Actor* theActor);
 
     virtual 
-    VISU_Actor* 
-    CloneActor(VISU_Actor* theActor);
+    void
+    UpdateFromActor(VISU_Actor* theActor);
 
     virtual 
     void