mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-25 01:20:36 +05:00
PAL8376
This commit is contained in:
parent
74382af355
commit
27e469cd20
@ -50,6 +50,9 @@
|
|||||||
#include <TopoDS_Edge.hxx>
|
#include <TopoDS_Edge.hxx>
|
||||||
#include <TopoDS_Face.hxx>
|
#include <TopoDS_Face.hxx>
|
||||||
#include <TopoDS_Iterator.hxx>
|
#include <TopoDS_Iterator.hxx>
|
||||||
|
#include <AIS_ListOfInteractive.hxx>
|
||||||
|
#include <AIS_ListIteratorOfListOfInteractive.hxx>
|
||||||
|
#include <V3d_Viewer.hxx>
|
||||||
|
|
||||||
#include "SALOME_Event.hxx"
|
#include "SALOME_Event.hxx"
|
||||||
|
|
||||||
@ -162,7 +165,6 @@ void GEOM_Swig::createAndDisplayGO(const char* Entry)
|
|||||||
Handle(GEOM_AISShape) aSh = new GEOM_AISShape(myShape,const_cast<char*>(myName));
|
Handle(GEOM_AISShape) aSh = new GEOM_AISShape(myShape,const_cast<char*>(myName));
|
||||||
aSh->setName(const_cast<char*>(myName));
|
aSh->setName(const_cast<char*>(myName));
|
||||||
aSh->setIO(myIO);
|
aSh->setIO(myIO);
|
||||||
|
|
||||||
ic->Display(aSh);
|
ic->Display(aSh);
|
||||||
ic->AddOrRemoveCurrentObject(aSh,true);
|
ic->AddOrRemoveCurrentObject(aSh,true);
|
||||||
}
|
}
|
||||||
@ -370,7 +372,26 @@ void GEOM_Swig::setColor(const char* theEntry, int red, int green, int blue)
|
|||||||
myRenderInter->Update();
|
myRenderInter->Update();
|
||||||
}else if(OCCViewer_ViewFrame* aViewFrame = GetFrame<OCCViewer_ViewFrame>(myStudy)){
|
}else if(OCCViewer_ViewFrame* aViewFrame = GetFrame<OCCViewer_ViewFrame>(myStudy)){
|
||||||
OCCViewer_Viewer3d* v3d = aViewFrame->getViewer();
|
OCCViewer_Viewer3d* v3d = aViewFrame->getViewer();
|
||||||
v3d->SetColor(myIO,myParam);
|
Handle(AIS_InteractiveContext) ic = aViewFrame->getViewer()->getAISContext();
|
||||||
|
AIS_ListOfInteractive List;
|
||||||
|
ic->DisplayedObjects(List);
|
||||||
|
AIS_ListIteratorOfListOfInteractive ite(List);
|
||||||
|
for ( ; ite.More(); ite.Next() ) {
|
||||||
|
Handle(SALOME_InteractiveObject) anObj =
|
||||||
|
Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
|
||||||
|
if ( !anObj.IsNull() && anObj->hasEntry() && anObj->isSame( myIO ) ) {
|
||||||
|
Quantity_Color CSFColor = Quantity_Color ( myParam.red() / 255.,
|
||||||
|
myParam.green() / 255.,
|
||||||
|
myParam.blue() / 255.,
|
||||||
|
Quantity_TOC_RGB );
|
||||||
|
ite.Value()->SetColor( CSFColor );
|
||||||
|
if ( ite.Value()->IsKind( STANDARD_TYPE(GEOM_AISShape) ) )
|
||||||
|
Handle(GEOM_AISShape)::DownCast( ite.Value() )->SetShadingColor( CSFColor );
|
||||||
|
ite.Value()->Redisplay( Standard_True );
|
||||||
|
v3d->getViewer3d()->Update();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -116,7 +116,6 @@ static void indicesToOwners( const TColStd_IndexedMapOfInteger& aIndexMap,
|
|||||||
GEOM_AISShape::GEOM_AISShape(const TopoDS_Shape& shape,
|
GEOM_AISShape::GEOM_AISShape(const TopoDS_Shape& shape,
|
||||||
const Standard_CString aName): SALOME_AISShape(shape)
|
const Standard_CString aName): SALOME_AISShape(shape)
|
||||||
{
|
{
|
||||||
myIO = NULL;
|
|
||||||
myName = new char [strlen(aName)+1];
|
myName = new char [strlen(aName)+1];
|
||||||
strcpy( myName, aName);
|
strcpy( myName, aName);
|
||||||
|
|
||||||
@ -124,15 +123,18 @@ GEOM_AISShape::GEOM_AISShape(const TopoDS_Shape& shape,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GEOM_AISShape::setIO(const Handle(SALOME_InteractiveObject)& io){
|
void GEOM_AISShape::setIO(const Handle(SALOME_InteractiveObject)& io){
|
||||||
myIO = io;
|
SetOwner( io );
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(SALOME_InteractiveObject) GEOM_AISShape::getIO(){
|
Handle(SALOME_InteractiveObject) GEOM_AISShape::getIO(){
|
||||||
return myIO;
|
Handle(SALOME_InteractiveObject) IO;
|
||||||
|
if ( !GetOwner().IsNull() )
|
||||||
|
IO = Handle(SALOME_InteractiveObject)::DownCast( GetOwner() );
|
||||||
|
return IO;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean GEOM_AISShape::hasIO(){
|
Standard_Boolean GEOM_AISShape::hasIO(){
|
||||||
return !myIO.IsNull();
|
return !getIO().IsNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GEOM_AISShape::setName(const Standard_CString aName)
|
void GEOM_AISShape::setName(const Standard_CString aName)
|
||||||
@ -140,8 +142,9 @@ void GEOM_AISShape::setName(const Standard_CString aName)
|
|||||||
myName = new char [strlen(aName)+1];
|
myName = new char [strlen(aName)+1];
|
||||||
strcpy( myName, aName);
|
strcpy( myName, aName);
|
||||||
|
|
||||||
if ( hasIO() )
|
Handle(SALOME_InteractiveObject) IO = getIO();
|
||||||
myIO->setName(aName);
|
if ( !IO.IsNull() )
|
||||||
|
IO->setName(aName);
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_CString GEOM_AISShape::getName(){
|
Standard_CString GEOM_AISShape::getName(){
|
||||||
|
@ -121,7 +121,6 @@ private:
|
|||||||
|
|
||||||
// Fields PRIVATE
|
// Fields PRIVATE
|
||||||
//
|
//
|
||||||
Handle_SALOME_InteractiveObject myIO;
|
|
||||||
Standard_CString myName;
|
Standard_CString myName;
|
||||||
Quantity_Color myShadingColor;
|
Quantity_Color myShadingColor;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user