*** empty log message ***

This commit is contained in:
vsv 2006-05-05 14:28:13 +00:00
parent 959c2b824c
commit 918efd9524
3 changed files with 64 additions and 0 deletions

View File

@ -231,6 +231,68 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
}
void GEOM_Swig::eraseGO (const char* Entry, bool allWindows)
{
class TEvent: public SALOME_Event
{
std::string myEntry;
bool myFromAllWindows;
public:
TEvent(const char* theEntry, bool fromAllWindows):
myEntry(theEntry), myFromAllWindows(fromAllWindows)
{}
virtual void Execute()
{
SUIT_Application* app = SUIT_Session::session()->activeApplication();
if (!app) return;
Handle (SALOME_InteractiveObject) aIO = new SALOME_InteractiveObject(myEntry.c_str(), "GEOM", "");
if (myFromAllWindows) {
QPtrList<SUIT_ViewWindow> aWindows = app->desktop()->windows();
SUIT_ViewWindow* aWin = 0;
for (aWin = aWindows.first(); aWin; aWin = aWindows.next()) {
EraseObject(aWin, aIO);
}
} else {
SUIT_ViewWindow* aWin = app->desktop()->activeWindow();
if (aWin)
EraseObject(aWin, aIO);
}
}
private:
void EraseObject(SUIT_ViewWindow* theWin, Handle (SALOME_InteractiveObject) theIO)
{
if (theWin->getViewManager()->getType() == OCCViewer_Viewer::Type()){
OCCViewer_ViewWindow* vw = dynamic_cast<OCCViewer_ViewWindow*>( theWin );
if ( vw ) {
OCCViewer_ViewManager* vm = dynamic_cast<OCCViewer_ViewManager*>( vw->getViewManager() );
if ( vm ) {
SOCC_Viewer* aViewer = dynamic_cast<SOCC_Viewer*>(vm->getOCCViewer());
if (aViewer) {
SALOME_Prs* aPrs = aViewer->CreatePrs(myEntry.c_str());
if (aPrs) {
SALOME_OCCPrs* aOccPrs = dynamic_cast<SALOME_OCCPrs*>(aPrs);
if (aOccPrs) {
aViewer->Erase(aOccPrs);
aViewer->Repaint();
}
}
}
}
}
} else if (theWin->getViewManager()->getType() == SVTK_Viewer::Type()){
SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>( theWin );
if (aViewWindow) {
aViewWindow->Erase(theIO);
}
}
}
};
ProcessVoidEvent(new TEvent(Entry, allWindows));
}
int GEOM_Swig::getIndexTopology(const char* SubIOR, const char* IOR)
{
GEOM::GEOM_Gen_var aGeomGen = GeometryGUI::GetGeomGen();

View File

@ -50,6 +50,7 @@ public:
~GEOM_Swig();
void createAndDisplayGO(const char* Entry);
void eraseGO(const char* Entry, bool allWindows);
void setDisplayMode(const char* Entry, int mode);
void setColor(const char* Entry, int red, int green, int blue);
void setTransparency(const char* Entry, float transp);

View File

@ -37,6 +37,7 @@ class GEOM_Swig
~GEOM_Swig();
void createAndDisplayGO(const char* Entry);
void eraseGO(const char* Entry, bool allWindows);
int getIndexTopology(const char *SubEntry, const char *Entry);
const char* getShapeTypeString(const char *Entry);