BIN =
BIN_SRC =
-CPPFLAGS+= $(OCC_INCLUDES) $(VTK_INCLUDES) \
- -I${KERNEL_ROOT_DIR}/include/salome \
+CPPFLAGS+= \
+ $(OCC_INCLUDES) \
+ $(VTK_INCLUDES) \
+ $(BOOST_CPPFLAGS) \
-I${MED_ROOT_DIR}/include/salome \
-I${GUI_ROOT_DIR}/include/salome \
- $(BOOST_CPPFLAGS)
+ -I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS+= $(VTK_LIBS) -lSalomeObject -lSVTK -lVisuPipeLine \
- -L${KERNEL_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome
+LDFLAGS+= \
+ $(VTK_LIBS) \
+ $(BOOST_LIBS) \
+ -L${GUI_ROOT_DIR}/lib/salome \
+ -L${KERNEL_ROOT_DIR}/lib/salome
+
+LIBS+= \
+ -lboost_signals-mt \
+ -lSalomeObject \
+ -lVisuPipeLine \
+ -lSVTK
@CONCLUDE@
//
//
//
-// File : VISU_Actor.cxx
-// Author : Laurent CORNABE with help of Nicolas REJNERI
+// File :
+// Author :
// Module : VISU
// $Header$
#include <vtkGeometryFilter.h>
#include <vtkObjectFactory.h>
+#include <boost/bind.hpp>
+
#include "utilities.h"
using namespace std;
vtkStandardNewMacro(VISU_Actor);
//----------------------------------------------------------------------------
-VISU_Actor::VISU_Actor():
+VISU_Actor
+::VISU_Actor():
myIsVTKMapping(false),
- myParent(this),
myPrs3d(NULL),
myActorFactory(NULL),
myMapper(vtkDataSetMapper::New()),
myAnnotationMapper(vtkTextMapper::New()),
myAnnotationActor(vtkTextActor::New())
{
+ if(MYDEBUG) MESSAGE("VISU_Actor() - this = "<<this);
SetDebug(MYVTKDEBUG);
myMapper->Delete();
VISU_Actor
::~VISU_Actor()
{
+ if(MYDEBUG) MESSAGE("~VISU_Actor() - this = "<<this);
SALOME_Actor::SetProperty(NULL);
}
}
//----------------------------------------------------------------------------
+VISU::TActorFactory*
+VISU_Actor
+::GetFactory()
+{
+ return myActorFactory;
+}
+
void
VISU_Actor
::SetFactory(VISU::TActorFactory* theActorFactory)
myActorFactory = theActorFactory;
}
-VISU::TActorFactory*
+void
VISU_Actor
-::GetFactory()
-{
- return myActorFactory;
+::Connect(VISU_Actor* theActor)
+{
+ mySetVisibilitySignal.connect(boost::bind(&VISU_Actor::SetVisibility,theActor,_1));
}
+void
+VISU_Actor
+::Update()
+{
+ myActorFactory->UpdateActor(this);
+ SALOME_Actor::Update();
+}
+
+
//----------------------------------------------------------------------------
void
VISU_Actor
return myPipeLine.GetPointer();
}
-//----------------------------------------------------------------------------
-void
-VISU_Actor
-::SetParent(VISU_Actor* theParent)
-{
- myParent = theParent;
-}
-
-VISU_Actor*
-VISU_Actor
-::GetParent()
-{
- return myParent;
-}
-
//----------------------------------------------------------------------------
void
::SetVisibility(int theMode)
{
SALOME_Actor::SetVisibility(theMode);
+ mySetVisibilitySignal(GetVisibility());
}
int
//
//
//
-// File : VISU_Actor.h
-// Author : Laurent CORNABE with the help of Nicolas REJNERI
+// File :
+// Author :
// Module : VISU
// $Header$
#include <string>
#include <vtkSmartPointer.h>
+#include <boost/signals/signal1.hpp>
class vtkProp;
class vtkProperty;
void
setIO(const Handle(SALOME_InteractiveObject)& theIO);
+ //----------------------------------------------------------------------------
VISU::Prs3d_i*
GetPrs3d();
void
SetPrs3d(VISU::Prs3d_i* thePrs3d);
+ //----------------------------------------------------------------------------
VISU::TActorFactory*
GetFactory();
void
SetFactory(VISU::TActorFactory* theActorFactory);
+ virtual
+ void
+ Connect(VISU_Actor* theActor);
+
+ virtual
+ void
+ Update();
+
+ //----------------------------------------------------------------------------
virtual
VISU_PipeLine*
GetPipeLine();
void
SetPipeLine(VISU_PipeLine* thePipeLine) ;
- VISU_Actor*
- GetParent();
-
- virtual
- void
- SetParent(VISU_Actor* theParent);
-
//----------------------------------------------------------------------------
virtual
void
protected:
VISU_Actor();
+
virtual
~VISU_Actor();
SetMapperInput(vtkDataSet* theDataSet);
bool myIsVTKMapping;
- VISU_Actor* myParent;
VISU::Prs3d_i* myPrs3d;
vtkSmartPointer<VISU_PipeLine> myPipeLine;
vtkSmartPointer<vtkDataSetMapper> myMapper;
+
VISU::TActorFactory* myActorFactory;
+ boost::signal1<void,int> mySetVisibilitySignal;
vtkSmartPointer<VTKViewer_ShrinkFilter> myShrinkFilter;
bool myIsShrinkable;
bool myIsShrunk;
+
vtkSmartPointer<vtkTextMapper> myAnnotationMapper;
vtkSmartPointer<vtkTextActor> myAnnotationActor;
};
{
virtual
VISU_Actor*
- CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL) = 0;
+ CloneActor(VISU_Actor* theActor) = 0;
+
+ virtual
+ void
+ UpdateActor(VISU_Actor* theActor) = 0;
virtual
void
m = vtkMatrix4x4::New();
mySurfaceActor = VISU_Actor::New();
- mySurfaceActor->SetParent(this);
mySurfaceActor->GetProperty()->FrontfaceCullingOff();
mySurfaceActor->GetProperty()->BackfaceCullingOff();
mySurfaceActor->SetUserMatrix(m);
mySurfaceActor->SetRepresentation(2); //SURFACE
myEdgeActor = VISU_Actor::New();
- myEdgeActor->SetParent(this);
myEdgeActor->PickableOff();
myEdgeActor->GetProperty()->FrontfaceCullingOff();
myEdgeActor->GetProperty()->BackfaceCullingOff();
myEdgeActor->SetRepresentation(1); //WIREFRAME
myNodeActor = VISU_Actor::New();
- myNodeActor->SetParent(this);
myNodeActor->PickableOff();
myNodeActor->GetProperty()->SetPointSize(SALOME_POINT_SIZE);
myNodeActor->GetProperty()->FrontfaceCullingOff();
void VISU_MeshAct::AddToRender(vtkRenderer* theRenderer){
VISU_Actor::AddToRender(theRenderer);
- theRenderer->AddActor(myEdgeActor);
+ //theRenderer->AddActor(myEdgeActor);
}
void VISU_MeshAct::RemoveFromRender(vtkRenderer* theRenderer){
VISU_Actor::RemoveFromRender(theRenderer);
- theRenderer->RemoveActor(myEdgeActor);
+ //theRenderer->RemoveActor(myEdgeActor);
}
void VISU_MeshAct::SetPipeLine(VISU_PipeLine* thePipeLine) {
myNodeActor->GetProperty()->Render(this, ren);
break;
case 1: //WIREFRAME
- //PAL5268: myEdgeActor->GetProperty()->Render(this, ren);
+ //PAL5268:
+ myEdgeActor->GetProperty()->Render(this, ren);
break;
case 2: //SURFACE
mySurfaceActor->GetProperty()->Render(this, ren);
break;
case 3: //INSIDEFRAME
- //PAL5268: myEdgeActor->GetProperty()->Render(this, ren);
+ //PAL5268:
+ myEdgeActor->GetProperty()->Render(this, ren);
break;
case 4: //SURFACEFRAME
- //PAL5268: myEdgeActor->GetProperty()->Render(this, ren);
+ //PAL5268:
mySurfaceActor->GetProperty()->Render(this, ren);
+ myEdgeActor->GetProperty()->Render(this, ren);
break;
}
matrix = myEdgeActor->GetUserMatrix();
break;
case 4: //SURFACEFRAME
- matrix = myEdgeActor->GetUserMatrix();
- this->GetMatrix(matrix);
matrix = mySurfaceActor->GetUserMatrix();
+ this->GetMatrix(matrix);
+ matrix = myEdgeActor->GetUserMatrix();
break;
}
this->GetMatrix(matrix);
myNodeActor->Render(ren,bestMapper);
break;
case 1: //WIREFRAME
- //PAL5268: myEdgeActor->Render(ren,bestMapper);
+ //PAL5268:
+ myEdgeActor->Render(ren,bestMapper);
break;
case 2: //SURFACE
mySurfaceActor->Render(ren,bestMapper);
break;
case 3: //INSIDEFRAME
- //PAL5268: myEdgeActor->Render(ren,bestMapper);
+ //PAL5268:
+ myEdgeActor->Render(ren,bestMapper);
break;
case 4: //SURFACEFRAME
- //PAL5268: myEdgeActor->Render(ren,bestMapper);
+ //PAL5268:
mySurfaceActor->Render(ren,bestMapper);
+ myEdgeActor->Render(ren,bestMapper);
break;
}
void VISU_MeshAct::Modified()
{
myNodeActor->Modified();
- //PAL5268: myEdgeActor->Modified();
+ //PAL5268:
+ myEdgeActor->Modified();
mySurfaceActor->Modified();
this->vtkActor::Modified();
}
vtkStandardNewMacro(VISU_ScalarMapAct);
-VISU_ScalarMapAct::VISU_ScalarMapAct(){
+VISU_ScalarMapAct
+::VISU_ScalarMapAct()
+{
myScalarBar = VISU_ScalarBarActor::New();
vtkProperty* aProperty = GetProperty();
myProperty->DeepCopy(aProperty);
}
-VISU_ScalarMapAct::~VISU_ScalarMapAct(){
+VISU_ScalarMapAct
+::~VISU_ScalarMapAct()
+{
myScalarBar->Delete();
}
-void VISU_ScalarMapAct::AddToRender(vtkRenderer* theRenderer){
- SALOME_Actor::AddToRender(theRenderer);
+void
+VISU_ScalarMapAct
+::AddToRender(vtkRenderer* theRenderer)
+{
+ VISU_Actor::AddToRender(theRenderer);
if(myScalarBar)
theRenderer->AddActor2D(myScalarBar);
}
-void VISU_ScalarMapAct::RemoveFromRender(vtkRenderer* theRenderer){
- SALOME_Actor::RemoveFromRender(theRenderer);
+void
+VISU_ScalarMapAct
+::RemoveFromRender(vtkRenderer* theRenderer)
+{
+ VISU_Actor::RemoveFromRender(theRenderer);
if(myScalarBar)
theRenderer->RemoveActor(myScalarBar);
}
-void VISU_ScalarMapAct::SetVisibility(int theMode){
- SALOME_Actor::SetVisibility(theMode);
+void
+VISU_ScalarMapAct
+::SetVisibility(int theMode)
+{
+ VISU_Actor::SetVisibility(theMode);
if(myScalarBar) myScalarBar->SetVisibility(myBarVisibility && theMode);
}
-int VISU_ScalarMapAct::GetVisibility(){
- return SALOME_Actor::GetVisibility();
+int
+VISU_ScalarMapAct
+::GetVisibility()
+{
+ return VISU_Actor::GetVisibility();
}
-void VISU_ScalarMapAct::SetBarVisibility(bool theMode){
+void
+VISU_ScalarMapAct
+::SetBarVisibility(bool theMode)
+{
myBarVisibility = theMode;
if(myScalarBar) myScalarBar->SetVisibility(myBarVisibility);
}
for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
if (anActor->GetVisibility() > 0)
if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
- anVISUActor = anVISUActor->GetParent();
anVISUActor->VisibilityOff();
}
}
EditPrs3d(VisuGUI* theModule,
VISU::Prs3d_i* thePrs3d)
{
- if(TPrs3d_i* aPrsObject = dynamic_cast<TPrs3d_i*>(thePrs3d)){
+ if(TPrs3d_i* aPrs3d = dynamic_cast<TPrs3d_i*>(thePrs3d)){
TDlg* aDlg = new TDlg (theModule);
- aDlg->initFromPrsObject(aPrsObject);
+ aDlg->initFromPrsObject(aPrs3d);
if (aDlg->exec()) {
- if (!(aDlg->storeToPrsObject(aPrsObject))) {
+ if (!(aDlg->storeToPrsObject(aPrs3d))) {
delete aDlg;
return;
}
- RecreateActor(theModule,aPrsObject);
+ aPrs3d->UpdateActors();
typedef typename TViewer::TViewWindow TViewWindow;
- if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule,true)){
+ if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule)){
aViewWindow->getRenderer()->ResetCameraClippingRange();
aViewWindow->Repaint();
}
// Optionally, create table and curves for cut lines
QApplication::setOverrideCursor(Qt::waitCursor);
CreateCurves( theModule,
- dynamic_cast<VISU::CutLines_i*>( aPrsObject ),
+ dynamic_cast<VISU::CutLines_i*>( aPrs3d ),
aDlg,
false ); // in edition mode
QApplication::restoreOverrideCursor();
VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor);
if (anVISUActor)
if (anVISUActor->GetVisibility() != 0) {
- VISU::Prs3d_i* aPrs = anVISUActor->GetParent()->GetPrs3d();
+ VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d();
if (aPrs) {
if (!myPrsMap.contains(aPrs)) {
SALOMEDS::SObject_var aSObject = aPrs->GetSObject();
VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d();
if(aPrs == NULL) continue;
if (thePrs == aPrs) {
- aResActor = anVISUActor->GetParent();
+ aResActor = anVISUActor;
thePrs->UpdateActor(aResActor);
aResActor->VisibilityOn();
} else if (theDispOnly) {
- anVISUActor->GetParent()->VisibilityOff();
+ anVISUActor->VisibilityOff();
} else {
}
} else if (theDispOnly && anActor->GetVisibility()) {
if(vtkRenderer* aRenderer = theViewWindow->getRenderer()){
if(vtkActorCollection* aCollection = aRenderer->GetActors()){
if(VISU_Actor* anActor = Find<VISU_Actor>(aCollection,TIsSameEntry<VISU_Actor>(theEntry))){
- return anActor->GetParent();
+ return anActor;
}
}
}
if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)){
if(VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d()){
if(thePrs == aPrs3d){
- aResActor = anActor->GetParent();
- thePrs->UpdateActor(aResActor);
+ aResActor = anActor;
+ thePrs->UpdateActors();
aResActor->VisibilityOn();
}else if(theDispOnly){
- anActor->GetParent()->VisibilityOff();
+ anActor->VisibilityOff();
}
}else if(theDispOnly && anActor->GetVisibility()){
anActor->VisibilityOff();
while(vtkActor *anAct = aCollection->GetNextActor()){
if(anAct->GetVisibility() > 0)
if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)){
- anActor = anActor->GetParent();
anActor->VisibilityOff();
}
}
if(vtkRenderer* aRenderer = theViewWindow->getRenderer()){
if(vtkActorCollection* aCollection = aRenderer->GetActors()){
if(VISU_Actor* anActor = Find<VISU_Actor>(aCollection,TIsSameEntry<VISU_Actor>(theEntry))){
- return anActor->GetParent();
+ return anActor;
}
}
}
# Libraries targets
LIB = libVISUEngineImpl.la
-LIB_SRC = VISUConfig.cc VISU_Gen_i.cc \
- VISU_Result_i.cc VISU_PrsObject_i.cc VISU_Table_i.cc \
- VISU_Prs3d_i.cc VISU_Mesh_i.cc VISU_ScalarMap_i.cc \
- VISU_IsoSurfaces_i.cc VISU_DeformedShape_i.cc \
- VISU_Plot3D_i.cc VISU_CutPlanes_i.cc VISU_CutLines_i.cc \
- VISU_Vectors_i.cc VISU_StreamLines_i.cc VISU_GaussPoints_i.cc \
- VISU_ViewManager_i.cc VISU_View_i.cc \
- VISU_TimeAnimation.cxx VISU_CorbaMedConvertor.cxx \
+LIB_SRC = \
+ VISUConfig.cc \
+ VISU_Gen_i.cc \
+ VISU_Result_i.cc \
+ VISU_PrsObject_i.cc \
+ VISU_Table_i.cc \
+ VISU_Prs3d_i.cc \
+ VISU_Mesh_i.cc \
+ VISU_ScalarMap_i.cc \
+ VISU_IsoSurfaces_i.cc \
+ VISU_DeformedShape_i.cc \
+ VISU_Plot3D_i.cc \
+ VISU_CutPlanes_i.cc \
+ VISU_CutLines_i.cc \
+ VISU_Vectors_i.cc \
+ VISU_StreamLines_i.cc \
+ VISU_GaussPoints_i.cc \
+ VISU_ViewManager_i.cc \
+ VISU_View_i.cc \
+ VISU_TimeAnimation.cxx \
+ VISU_CorbaMedConvertor.cxx \
VISU_DumpPython.cc
-LIB_MOC = VISU_TimeAnimation.h
+LIB_MOC = \
+ VISU_TimeAnimation.h
-LIB_SERVER_IDL = VISU_Gen.idl SALOME_Component.idl \
- SALOME_Exception.idl SALOME_GenericObj.idl MED.idl
+LIB_SERVER_IDL = \
+ MED.idl \
+ VISU_Gen.idl \
+ SALOME_Component.idl \
+ SALOME_Exception.idl \
+ SALOME_GenericObj.idl
-LIB_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Comm.idl
+LIB_CLIENT_IDL = \
+ SALOMEDS.idl \
+ SALOMEDS_Attributes.idl \
+ SALOME_Comm.idl
# Executables targets
-BIN =
+BIN = VISU_I
BIN_SRC =
BIN_CLIENT_IDL =
BIN_SERVER_IDL =
-EXPORT_HEADERS = VISUConfig.hh VISU_Gen_i.hh \
- VISU_Result_i.hh VISU_PrsObject_i.hh VISU_Table_i.hh \
- VISU_Prs3d_i.hh VISU_Mesh_i.hh VISU_ScalarMap_i.hh \
- VISU_IsoSurfaces_i.hh VISU_DeformedShape_i.hh \
- VISU_Plot3D_i.hh VISU_CutPlanes_i.hh VISU_CutLines_i.hh \
- VISU_Vectors_i.hh VISU_StreamLines_i.hh VISU_GaussPoints_i.hh \
- VISU_ViewManager_i.hh VISU_View_i.hh \
+EXPORT_HEADERS = \
+ VISUConfig.hh \
+ VISU_Gen_i.hh \
+ VISU_Result_i.hh \
+ VISU_PrsObject_i.hh \
+ VISU_Table_i.hh \
+ VISU_Prs3d_i.hh \
+ VISU_Mesh_i.hh \
+ VISU_ScalarMap_i.hh \
+ VISU_IsoSurfaces_i.hh \
+ VISU_DeformedShape_i.hh \
+ VISU_Plot3D_i.hh \
+ VISU_CutPlanes_i.hh \
+ VISU_CutLines_i.hh \
+ VISU_Vectors_i.hh \
+ VISU_StreamLines_i.hh \
+ VISU_GaussPoints_i.hh \
+ VISU_ViewManager_i.hh \
+ VISU_View_i.hh \
VISU_TimeAnimation.h
# additionnal information to compil and link file
-CPPFLAGS += -ftemplate-depth-32 $(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) \
- $(HDF5_INCLUDES) $(QWT_INCLUDES) $(BOOST_CPPFLAGS)\
+CPPFLAGS += \
+ -ftemplate-depth-32 \
+ $(QT_INCLUDES) \
+ $(PYTHON_INCLUDES) \
+ $(OCC_INCLUDES) \
+ $(VTK_INCLUDES) \
+ $(HDF5_INCLUDES) \
+ $(QWT_INCLUDES) \
+ $(BOOST_CPPFLAGS)\
-I${KERNEL_ROOT_DIR}/include/salome \
-I${MED_ROOT_DIR}/include/salome \
-I${GUI_ROOT_DIR}/include/salome
-LDFLAGS += $(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) $(QWT_LIBS) -lSalomeNS -lTOOLSDS \
- -lSalomeContainer -lOpUtil -lSalomeApp -lVTKViewer -lSVTK -lSPlot2d -lSalomeHDFPersist \
- -lSalomeGenericObj -lVisuConvertor -lVisuPipeLine -lVisuObject -lVISUGUITOOLS \
+LDFLAGS += \
+ $(PYTHON_LIBS) \
+ $(QT_MT_LIBS) \
+ $(VTK_LIBS) \
+ $(QWT_LIBS) \
+ $(BOOST_LIBS) \
-L${KERNEL_ROOT_DIR}/lib/salome \
- -L${GUI_ROOT_DIR}/lib/salome -lEvent
-
-LIBS+= -lPlot2d -L${KERNEL_ROOT_DIR}/lib/salome
+ -L${GUI_ROOT_DIR}/lib/salome
+
+LIBS+= -lboost_signals-mt \
+ -lSalomeHDFPersist \
+ -lSalomeGenericObj \
+ -lSalomeContainer \
+ -lSalomeNS \
+ -lTOOLSDS \
+ -lOpUtil \
+ -lEvent \
+ -lCASCatch \
+ -lSalomeApp \
+ -lSalomeSession \
+ -lVTKViewer \
+ -lSVTK \
+ -lSPlot2d \
+ -lVisuConvertor \
+ -lVisuPipeLine \
+ -lVisuObject \
+ -lVISUGUITOOLS
+
+LDFLAGSFORBIN=$(LDFLAGS) $(LIBS)
# additional file to be cleaned
MOSTLYCLEAN =
#include "Utils_CorbaException.hxx"
#include "utilities.h"
-#include <SALOMEDSClient_SObject.hxx>
-#include <SALOMEDSClient_Study.hxx>
+#include "SALOMEDSClient_SObject.hxx"
+#include "SALOMEDSClient_Study.hxx"
// QT headers
#include <qstring.h>
class SUIT_Session;
class SUIT_ResourceMgr;
-
-namespace VISU{
+namespace VISU
+{
SUIT_Session *GetSession();
SUIT_ResourceMgr *GetResourceMgr();
//----------------------------------------------------------------------------
int
VISU::GaussPoints_i
-::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck)
+::IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theIteration,
+ int isMemoryCheck)
{
try{
if(theEntity != VISU::NODE)
::Create(const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, int theIteration)
{
- return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+ return VISU::ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
}
::Restore(const Storable::TRestoringMap& theMap)
{
DoHook();
- return ScalarMap_i::Restore(theMap);
+ return VISU::ScalarMap_i::Restore(theMap);
}
VISU::GaussPoints_i
::ToStream(std::ostringstream& theStr)
{
- ScalarMap_i::ToStream(theStr);
+ VISU::ScalarMap_i::ToStream(theStr);
}
}
+//----------------------------------------------------------------------------
+VISU_Actor*
+VISU::GaussPoints_i
+::CloneActor(VISU_Actor* theActor)
+{
+ VISU::ScalarMap_i::CloneActor(theActor);
+}
+
+
//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
Storable*
Restore(const Storable::TRestoringMap& theMap);
+ //----------------------------------------------------------------------------
virtual
VISU_Actor*
CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
void
UpdateActor(VISU_Actor* theActor);
+ virtual
+ VISU_Actor*
+ CloneActor(VISU_Actor* theActor);
+
+ //----------------------------------------------------------------------------
virtual
void
SetImplicitFunction(VISU_Actor* theActor,
static QFileInfo aFileInfo;
#ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
#else
static int MYDEBUG = 0;
#endif
if (SUIT_Study* aSStudy = anApp->activeStudy()) {
if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
if (_PTR(Study) aCStudy = aStudy->studyDS()) {
- MESSAGE("There is an application with active study : StudyId = "
- << aCStudy->StudyId() << "; Name = '" << aCStudy->Name() << "'");
+ if(MYDEBUG) MESSAGE("There is an application with active study : StudyId = "
+ << aCStudy->StudyId() << "; Name = '" << aCStudy->Name() << "'");
if (myStudyName == aCStudy->Name()) {
isActive = true;
break;
{
CORBA::String_var aName = theStudy->Name();
std::string aStudyName (aName.in());
- MESSAGE("StudyId = " << theStudy->StudyId() << "; Name = '" << aName.in() << "'");
+ if(MYDEBUG) MESSAGE("StudyId = " << theStudy->StudyId() << "; Name = '" << aName.in() << "'");
myStudyDocument = SALOMEDS::Study::_duplicate(theStudy);
ProcessVoidEvent(new TEvent(aStudyName));
} else {
- MESSAGE("CORBA::is_nil(theStudy)");
+ INFOS("CORBA::is_nil(theStudy)");
}
}
--- /dev/null
+// SALOME VTKViewer : build VTK viewer into Salome desktop
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File :
+// Author :
+// Module :
+// $Header$
+
+#include "VISUConfig.hh"
+#include "VISU_Gen_i.hh"
+#include "VISU_Result_i.hh"
+#include "VISU_PrsObject_i.hh"
+#include "VISU_Table_i.hh"
+#include "VISU_Prs3d_i.hh"
+#include "VISU_Mesh_i.hh"
+#include "VISU_ScalarMap_i.hh"
+#include "VISU_IsoSurfaces_i.hh"
+#include "VISU_DeformedShape_i.hh"
+#include "VISU_DeformedShape_i.hh"
+#include "VISU_Plot3D_i.hh"
+#include "VISU_CutPlanes_i.hh"
+#include "VISU_CutLines_i.hh"
+#include "VISU_Vectors_i.hh"
+#include "VISU_StreamLines_i.hh"
+#include "VISU_GaussPoints_i.hh"
+#include "VISU_ViewManager_i.hh"
+#include "VISU_View_i.hh"
+#include "VISU_TimeAnimation.h"
+
+int
+main(int argc, char** argv)
+{
+ return 0;
+}
// Module : VISU
#include "VISU_PipeLine.hxx"
-#include "VISU_Result_i.hh"
#include "VISU_Prs3d_i.hh"
+
+#include "VISU_Result_i.hh"
#include "VISU_Actor.h"
#include <vtkGeometryFilter.h>
#include <vtkDataSetMapper.h>
+#include <boost/bind.hpp>
+
using namespace VISU;
using namespace std;
#ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
#else
static int MYDEBUG = 0;
#endif
anIO = new SALOME_InteractiveObject(mySObject->GetID(),"VISU",GetName());
theActor->setIO(anIO);
}
- theActor->SetPipeLine(GetPipeLine());
theActor->SetFactory(this);
+ myUpdateActorsSignal.connect(boost::bind(&VISU_Actor::Update,theActor));
+
+ theActor->SetPipeLine(GetPipeLine());
theActor->SetPrs3d(this);
theActor->SetPosition(myOffset);
}catch(std::bad_alloc& ex){
theActor->Modified();
}
+VISU_Actor*
+VISU::Prs3d_i
+::CloneActor(VISU_Actor* theActor)
+{
+ VISU_Actor* anActor = CreateActor();
+ theActor->Connect(anActor);
+ return anActor;
+}
+
+void
+VISU::Prs3d_i
+::UpdateActors()
+{
+ if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActors() - this = "<<this);
+ Update();
+ myUpdateActorsSignal();
+}
+
//----------------------------------------------------------------------------
void
#define VISU_Prs3d_i_HeaderFile
#include "VISU_PrsObject_i.hh"
+
#include "VISU_ActorFactory.h"
#include "VISU_ConvertorDef.hxx"
#include "SALOME_InteractiveObject.hxx"
#include <vtkPlaneSource.h>
+#include <boost/signals/signal0.hpp>
class VISU_PipeLine;
class VISU_Actor;
SALOMEDS::SObject_var mySObject;
std::string myMeshName;
+ boost::signal0<void> myUpdateActorsSignal;
+
void
CreateActor(VISU_Actor* theActor,
const Handle(SALOME_InteractiveObject)& theIO = NULL);
void
UpdateActor(VISU_Actor* theActor);
+ virtual
+ VISU_Actor*
+ CloneActor(VISU_Actor* theActor);
+
+ virtual
+ void
+ UpdateActors();
+
//----------------------------------------------------------------------------
virtual
void
if(anActor->IsA("VISU_Actor")){
anVISUActor = VISU_Actor::SafeDownCast(anActor);
if (thePrs == anVISUActor->GetPrs3d()) {
- aResActor = anVISUActor->GetParent();
+ aResActor = anVISUActor;
if(theDisplaing < eErase)
aResActor->VisibilityOn();
else
while (vtkActor *anActor = anActColl->GetNextActor())
if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor))
if (thePrs3d == anVISUActor->GetPrs3d())
- return anVISUActor->GetParent();
+ return anVISUActor;
return NULL;
}
for (; !anActor && aVTKActor; aVTKActor = anActColl->GetNextActor()) {
if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(aVTKActor)) {
if (thePrs == anVISUActor->GetPrs3d()) {
- anActor = anVISUActor->GetParent();
+ anActor = anVISUActor;
}
}
}
myImplicitFunctionWidget1->AddObserver(vtkCommand::EndInteractionEvent,
myEventCallbackCommand.GetPointer(),
myPriority);
+ myImplicitFunctionWidget1->AddObserver(vtkCommand::EnableEvent,
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
+ myImplicitFunctionWidget1->AddObserver(vtkCommand::DisableEvent,
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
myImplicitFunction = myImplicitFunctionWidget1->ImplicitFunction();
}
SVTK_ViewWindow::AddActor(theActor,theIsUpdate);
if(VISU_Actor* anAct = dynamic_cast<VISU_Actor*>(theActor))
if(VISU::TActorFactory* aFactory = anAct->GetFactory())
- if(VISU_Actor* anActor = aFactory->CreateActor())
+ if(VISU_Actor* anActor = aFactory->CloneActor(anAct))
myMainWindow2->AddActor(anActor,theIsUpdate);
}
myMainWindow2->RemoveActor(theActor,theIsUpdate);
}
+//----------------------------------------------------------------------------
+void
+VVTK_ViewWindow
+::Repaint(bool theUpdateTrihedron)
+{
+ myMainWindow->Repaint(theUpdateTrihedron);
+ myMainWindow2->Repaint(theUpdateTrihedron);
+}
+
//----------------------------------------------------------------------------
void
VVTK_ViewWindow
virtual
~VVTK_ViewWindow();
+ virtual
+ void
+ Initialize(SVTK_ViewModelBase* theModel);
+
virtual
void
AddActor(VTKViewer_Actor* theActor,
virtual
void
- Initialize(SVTK_ViewModelBase* theModel);
+ Repaint(bool theUpdateTrihedron = true);
public slots:
virtual