0025373: Visualization, AIS_MultipleConnectedInteractive - transformation persistence...
authorkgv <kgv@opencascade.com>
Wed, 15 Oct 2014 11:20:26 +0000 (15:20 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 23 Oct 2014 12:20:43 +0000 (16:20 +0400)
Provide method AIS_MultipleConnectedInteractive::Connect() taking transformation persistence flags.
Copy transformation persistence flags from original objects when called Connect() without extra arguments.

src/AIS/AIS_MultipleConnectedInteractive.cdl
src/AIS/AIS_MultipleConnectedInteractive.cxx

index 15030d2..ddc1dcc 100644 (file)
@@ -38,26 +38,42 @@ uses
     Transformation        from Geom,
     Integer                from Standard,
     Selection              from SelectMgr,
-    Trsf                  from gp
+    Trsf                  from gp,
+    Pnt                   from gp,
+    TransModeFlags        from Graphic3d
 
 is 
-    
 
     Create
     returns  MultipleConnectedInteractive  from  AIS;
     ---Purpose: Initializes the Interactive Object with multiple
     -- connections to AIS_Interactive objects.
-    
-    Connect(me             : mutable; 
-           theInteractive : InteractiveObject from AIS);
-    ---Purpose: Adds instance of theInteractive to child list.
-
-    Connect(me:mutable;
-            anotherIobj: InteractiveObject from AIS;
-            aLocation : Trsf from gp) is virtual;
-        ---Purpose: Establishes the connection between the Connected
-        -- Interactive Object, anotherIobj, and its reference.
-        -- Locates instance in aLocation.
+
+    Connect (me             : mutable;
+             theInteractive : InteractiveObject from AIS)
+    returns InteractiveObject from AIS;
+    ---Purpose: Establishes the connection between the Connected Interactive Object, theInteractive, and its reference.
+    -- Copies local transformation and transformation persistence mode from theInteractive.
+    -- @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive)
+
+    Connect (me             : mutable;
+             theInteractive : InteractiveObject from AIS;
+             theLocation    : Trsf from gp)
+    returns InteractiveObject from AIS;
+    ---Purpose: Establishes the connection between the Connected Interactive Object, theInteractive, and its reference.
+    -- Locates instance in theLocation and copies transformation persistence mode from theInteractive.
+    -- @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive)
+
+    Connect (me               : mutable;
+             theInteractive   : InteractiveObject from AIS;
+             theLocation      : Trsf from gp;
+             theTrsfPersFlag  : TransModeFlags from Graphic3d;
+             theTrsfPersPoint : Pnt from gp )
+    returns InteractiveObject from AIS
+    is virtual;
+    ---Purpose: Establishes the connection between the Connected Interactive Object, theInteractive, and its reference.
+    -- Locates instance in theLocation and applies specified transformation persistence mode.
+    -- @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive)
 
     Type(me) returns KindOfInteractive from AIS
     is redefined virtual;        
index 91c37f5..4cde3df 100644 (file)
@@ -182,10 +182,12 @@ Standard_Integer AIS_MultipleConnectedInteractive::Signature() const
 
 //=======================================================================
 //function : Connect
-//purpose  : 
+//purpose  :
 //=======================================================================
-void AIS_MultipleConnectedInteractive::Connect (const Handle(AIS_InteractiveObject)& theAnotherObj,
-                                                const gp_Trsf&                       theTransformation)
+Handle(AIS_InteractiveObject) AIS_MultipleConnectedInteractive::Connect (const Handle(AIS_InteractiveObject)& theAnotherObj,
+                                                                         const gp_Trsf&                       theTransformation,
+                                                                         const Graphic3d_TransModeFlags&      theTrsfPersFlag,
+                                                                         const gp_Pnt&                        theTrsfPersPoint)
 {
   Handle(AIS_InteractiveObject) anObjectToAdd;
 
@@ -219,16 +221,35 @@ void AIS_MultipleConnectedInteractive::Connect (const Handle(AIS_InteractiveObje
   }
 
   anObjectToAdd->SetLocalTransformation (theTransformation);
+  if (theTrsfPersFlag != Graphic3d_TMF_None)
+  {
+    anObjectToAdd->SetTransformPersistence (theTrsfPersFlag, theTrsfPersPoint);
+  }
   AddChild (anObjectToAdd);
+  return anObjectToAdd;
 }
 
 //=======================================================================
 //function : Connect
-//purpose  : 
+//purpose  :
+//=======================================================================
+Handle(AIS_InteractiveObject) AIS_MultipleConnectedInteractive::Connect (const Handle(AIS_InteractiveObject)& theAnotherObj)
+{
+  return Connect (theAnotherObj, theAnotherObj->LocalTransformation(),
+                  theAnotherObj->GetTransformPersistenceMode(),
+                  theAnotherObj->GetTransformPersistencePoint());
+}
+
+//=======================================================================
+//function : Connect
+//purpose  :
 //=======================================================================
-void AIS_MultipleConnectedInteractive::Connect (const Handle(AIS_InteractiveObject)& theAnotherObj)
+Handle(AIS_InteractiveObject) AIS_MultipleConnectedInteractive::Connect (const Handle(AIS_InteractiveObject)& theAnotherObj,
+                                                                         const gp_Trsf&                       theTransformation)
 {
-  Connect (theAnotherObj, theAnotherObj->LocalTransformation());
+  return Connect (theAnotherObj, theTransformation,
+                  theAnotherObj->GetTransformPersistenceMode(),
+                  theAnotherObj->GetTransformPersistencePoint());
 }
 
 //=======================================================================