1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-07 18:30:55 +03:00

0025373: Visualization, AIS_MultipleConnectedInteractive - transformation persistence flags are ignored for connected objects

Provide method AIS_MultipleConnectedInteractive::Connect() taking transformation persistence flags.
Copy transformation persistence flags from original objects when called Connect() without extra arguments.
This commit is contained in:
kgv 2014-10-15 15:20:26 +04:00 committed by bugmaster
parent 191082ac71
commit ba9e14dfb9
2 changed files with 55 additions and 18 deletions

View File

@ -38,26 +38,42 @@ uses
Transformation from Geom, Transformation from Geom,
Integer from Standard, Integer from Standard,
Selection from SelectMgr, Selection from SelectMgr,
Trsf from gp Trsf from gp,
Pnt from gp,
TransModeFlags from Graphic3d
is is
Create Create
returns MultipleConnectedInteractive from AIS; returns MultipleConnectedInteractive from AIS;
---Purpose: Initializes the Interactive Object with multiple ---Purpose: Initializes the Interactive Object with multiple
-- connections to AIS_Interactive objects. -- connections to AIS_Interactive objects.
Connect(me : mutable; Connect (me : mutable;
theInteractive : InteractiveObject from AIS); theInteractive : InteractiveObject from AIS)
---Purpose: Adds instance of theInteractive to child list. 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; Connect (me : mutable;
anotherIobj: InteractiveObject from AIS; theInteractive : InteractiveObject from AIS;
aLocation : Trsf from gp) is virtual; theLocation : Trsf from gp)
---Purpose: Establishes the connection between the Connected returns InteractiveObject from AIS;
-- Interactive Object, anotherIobj, and its reference. ---Purpose: Establishes the connection between the Connected Interactive Object, theInteractive, and its reference.
-- Locates instance in aLocation. -- 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 Type(me) returns KindOfInteractive from AIS
is redefined virtual; is redefined virtual;

View File

@ -184,8 +184,10 @@ Standard_Integer AIS_MultipleConnectedInteractive::Signature() const
//function : Connect //function : Connect
//purpose : //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) const gp_Trsf& theTransformation,
const Graphic3d_TransModeFlags& theTrsfPersFlag,
const gp_Pnt& theTrsfPersPoint)
{ {
Handle(AIS_InteractiveObject) anObjectToAdd; Handle(AIS_InteractiveObject) anObjectToAdd;
@ -219,16 +221,35 @@ void AIS_MultipleConnectedInteractive::Connect (const Handle(AIS_InteractiveObje
} }
anObjectToAdd->SetLocalTransformation (theTransformation); anObjectToAdd->SetLocalTransformation (theTransformation);
if (theTrsfPersFlag != Graphic3d_TMF_None)
{
anObjectToAdd->SetTransformPersistence (theTrsfPersFlag, theTrsfPersPoint);
}
AddChild (anObjectToAdd); AddChild (anObjectToAdd);
return anObjectToAdd;
} }
//======================================================================= //=======================================================================
//function : Connect //function : Connect
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MultipleConnectedInteractive::Connect (const Handle(AIS_InteractiveObject)& theAnotherObj) Handle(AIS_InteractiveObject) AIS_MultipleConnectedInteractive::Connect (const Handle(AIS_InteractiveObject)& theAnotherObj)
{ {
Connect (theAnotherObj, theAnotherObj->LocalTransformation()); return Connect (theAnotherObj, theAnotherObj->LocalTransformation(),
theAnotherObj->GetTransformPersistenceMode(),
theAnotherObj->GetTransformPersistencePoint());
}
//=======================================================================
//function : Connect
//purpose :
//=======================================================================
Handle(AIS_InteractiveObject) AIS_MultipleConnectedInteractive::Connect (const Handle(AIS_InteractiveObject)& theAnotherObj,
const gp_Trsf& theTransformation)
{
return Connect (theAnotherObj, theTransformation,
theAnotherObj->GetTransformPersistenceMode(),
theAnotherObj->GetTransformPersistencePoint());
} }
//======================================================================= //=======================================================================