1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0023432: Connected Interactive Objects computed without Interactive Context

Setup interactive context for reference(s) in Compute() method of classes AIS_ConnectedInteractive and AIS_MultipleConnectedInteractive
Extend vconnectsh and vconnect to process several input objects, added displaying color for result object
Fixed errors in QAGetPixelColor DRAW command
Edit QAGetPixelColor command and test case
ViewerTest::GetColorFromName() - fixed iteration bounds
QAAISGetPixelColor() - removed redundant conversions
Turn back QAGetPixelColor output syntax in case of 3 arguments
Integration of test script to new test system
This commit is contained in:
kgv
2012-11-15 13:27:18 +04:00
parent f6f03db9d0
commit 792c785cfb
8 changed files with 405 additions and 196 deletions

View File

@@ -105,30 +105,39 @@ void AIS_ConnectedInteractive::Disconnect()
}
//=======================================================================
//function : Compute
//purpose :
//purpose :
//=======================================================================
void AIS_ConnectedInteractive::
Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode)
void AIS_ConnectedInteractive::Compute (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
static Handle(Geom_Transformation) myPrsTrans ;
if(!(HasLocation() ||HasConnection())) return;
if(HasConnection()){
aPresentation->Clear(Standard_False);
aPresentation->RemoveAll();
aPresentationManager->Connect( this,myReference, aMode, aMode);
if(aPresentationManager->Presentation(myReference,aMode)->MustBeUpdated())
aPresentationManager->Update(myReference,aMode);
if (!(HasLocation() || HasConnection()))
{
return;
}
if(HasLocation()){
myPrsTrans = new Geom_Transformation(myLocation.Transformation());
aPresentationManager->Transform(this, myPrsTrans, aMode); }
aPresentation->ReCompute();
if (HasConnection())
{
thePrs->Clear (Standard_False);
thePrs->RemoveAll();
if (!myReference->HasInteractiveContext())
{
myReference->SetContext (GetContext());
}
thePrsMgr->Connect (this, myReference, theMode, theMode);
if (thePrsMgr->Presentation (myReference, theMode)->MustBeUpdated())
{
thePrsMgr->Update (myReference, theMode);
}
}
if (HasLocation())
{
Handle(Geom_Transformation) aPrsTrans = new Geom_Transformation (myLocation.Transformation());
thePrsMgr->Transform (this, aPrsTrans, theMode);
}
thePrs->ReCompute();
}
void AIS_ConnectedInteractive::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)

View File

@@ -95,7 +95,7 @@ is
-- compute anything, but just uses the
-- presentation of this last object, with
-- a transformation if there's one stored.
is redefined virtual private;
is redefined virtual protected;
Compute(me:mutable;
aPresentationManager: PresentationManager2d from PrsMgr;

View File

@@ -130,32 +130,35 @@ void AIS_MultipleConnectedInteractive::DisconnectAll ()
//=======================================================================
//function : Compute
//purpose :
//purpose :
//=======================================================================
void AIS_MultipleConnectedInteractive::Compute
(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode)
void AIS_MultipleConnectedInteractive::Compute (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
//cout<<"AIS_MultipleConnectedInteractive::Compute"<<endl;
thePrs->Clear (Standard_False);
thePrs->RemoveAll();
if (HasConnection())
{
for (Standard_Integer aRefIter = 1; aRefIter <= myReferences.Length(); ++aRefIter)
{
const Handle (AIS_InteractiveObject)& aRef = myReferences.Value (aRefIter);
if (!aRef->HasInteractiveContext())
{
aRef->SetContext (GetContext());
}
aPresentation->Clear(Standard_False);
aPresentation->RemoveAll();
if(HasConnection()) {
for (Standard_Integer I=1 ; I<= myReferences.Length(); I++) {
const Handle (AIS_InteractiveObject)& aReference = myReferences.Value (I);
aPresentationManager->Connect( this, aReference, aMode, aMode);
if(aPresentationManager->Presentation(aReference,aMode)->MustBeUpdated())
aPresentationManager->Update(aReference,aMode);
thePrsMgr->Connect (this, aRef, theMode, theMode);
if (thePrsMgr->Presentation (aRef, theMode)->MustBeUpdated())
{
thePrsMgr->Update (aRef, theMode);
}
}
}
aPresentation->ReCompute();
thePrs->ReCompute();
}
//=======================================================================
//function : Compute
//purpose :

View File

@@ -164,12 +164,11 @@ void AIS_MultipleConnectedShape::Compute(const Handle(Prs3d_Projector)& aProject
//purpose :
//=======================================================================
void AIS_MultipleConnectedShape::Compute(const Handle_PrsMgr_PresentationManager3d& /*aPresentationManager3d*/,
const Handle_Prs3d_Presentation& /*aPresentation*/,
const int /*anint*/)
void AIS_MultipleConnectedShape::Compute(const Handle_PrsMgr_PresentationManager3d& aPresentationManager3d,
const Handle_Prs3d_Presentation& aPresentation,
const int anint)
{
Standard_NotImplemented::Raise("AIS_MultipleConnectedShape::Compute(const Handle_PrsMgr_PresentationManager3d&, const Handle_Prs3d_Presentation&, const int)");
// AIS_MultipleConnectedInteractive::Compute( aPresentationManager3d , aPresentation , anint ) ; Not accessible
AIS_MultipleConnectedInteractive::Compute( aPresentationManager3d , aPresentation , anint ) ;
}
//=======================================================================