//----------------------------------------------------------------------------
void
VISU_Actor
-::ShallowCopy(vtkProp *prop)
+::DeepCopy(VISU_Actor *theActor)
{
- VISU_Actor *anActor = VISU_Actor::SafeDownCast(prop);
- if(anActor != NULL){
- setName(anActor->getName());
- if(anActor->hasIO()) setIO(anActor->getIO());
- }
- Superclass::ShallowCopy(prop);
+ highlight(theActor->isHighlighted());
+ SetRepresentation(theActor->GetRepresentation());
+ SetShrinkable(theActor->IsShrunkable());
+ SetShrinkFactor(theActor->GetShrinkFactor());
+ if(theActor->IsShrunk())
+ SetShrink();
+ else
+ UnShrink();
+ SetOpacity(theActor->GetOpacity());
+ SetLineWidth(theActor->GetLineWidth());
+ SetPosition(theActor->GetPosition());
}
+
+//----------------------------------------------------------------------------
void
VISU_Actor
::ShallowCopyPL(VISU_PipeLine* thePipeLine)
return GetCurrentPL()->GetOutput();
}
+//----------------------------------------------------------------------------
+unsigned long int
+VISU_Actor
+::GetMemorySize()
+{
+ vtkDataSet* aDataSet = GetMapper()->GetInput();
+ unsigned long int aSize = aDataSet->GetActualMemorySize();
+ return aSize * 1024;
+}
+
//----------------------------------------------------------------------------
vtkIdType
VISU_Actor
VISU_Actor*
New();
+ //! Copies all properties from the given actor
+ virtual
void
- ShallowCopy(vtkProp *prop);
+ DeepCopy(VISU_Actor *theActor);
virtual
void
vtkDataSet*
GetInput();
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
//----------------------------------------------------------------------------
virtual
vtkIdType
return myGaussPointsPL.GetPointer();
}
+//----------------------------------------------------------------------------
+void
+VISU_GaussPtsAct
+::DeepCopy(VISU_Actor *theActor)
+{
+ if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
+ Superclass::DeepCopy(theActor);
+ SetBarVisibility(anActor->GetBarVisibility());
+ }
+}
+
+//----------------------------------------------------------------------------
void
VISU_GaussPtsAct
::ShallowCopyPL(VISU_PipeLine* thePipeLine)
}
+//----------------------------------------------------------------------------
+unsigned long int
+VISU_GaussPtsAct
+::GetMemorySize()
+{
+ unsigned long int aSize = Superclass::GetMemorySize();
+ vtkDataSet* aDataSet = myDeviceActor->GetMapper()->GetInput();
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+ return aSize;
+}
+
//----------------------------------------------------------------------------
void
VISU_GaussPtsAct
Superclass::OnInteractorEvent(theEvent);
}
+//----------------------------------------------------------------------------
+unsigned long int
+VISU_GaussPtsAct1
+::GetMemorySize()
+{
+ unsigned long int aSize = Superclass::GetMemorySize();
+ {
+ vtkDataSet* aDataSet = myInsideDeviceActor->GetMapper()->GetInput();
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+ }
+ {
+ vtkDataSet* aDataSet = myOutsideDeviceActor->GetMapper()->GetInput();
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+ }
+ return aSize;
+}
+
+
//==============================================================================
vtkStandardNewMacro(VISU_GaussPtsAct2);
VISU_GaussPointsPL*
GetGaussPointsPL();
+ //! Copies all properties from the given actor
+ virtual
+ void
+ DeepCopy(VISU_Actor *theActor);
+
virtual
void
ShallowCopyPL(VISU_PipeLine* thePipeLine);
vtkDataSet*
GetInput();
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
//----------------------------------------------------------------------------
virtual
void
bool
GetBarVisibility();
- virtual void SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
+ virtual
+ void
+ SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
//! Return the information about pipeline magnification changing.
/*! True indicates that magnification is increased, false - decreased. */
void
SetTransform(VTKViewer_Transform* theTransform);
- virtual void SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
+ virtual
+ void
+ SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
protected:
//----------------------------------------------------------------------------
VISU_GaussPtsAct1();
void
SetVisibility(int theMode);
- virtual void SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
+ virtual
+ void
+ SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
protected:
//----------------------------------------------------------------------------
}
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::DeepCopy(VISU_Actor *theActor)
+{
+ if(VISU_MeshAct* anActor = dynamic_cast<VISU_MeshAct*>(theActor)){
+ Superclass::DeepCopy(theActor);
+ GetSurfaceProperty()->DeepCopy(anActor->GetSurfaceProperty());
+ GetEdgeProperty()->DeepCopy(anActor->GetEdgeProperty());
+ GetNodeProperty()->DeepCopy(anActor->GetNodeProperty());
+ }
+}
+
+
//----------------------------------------------------------------------------
void
VISU_MeshAct
myEdgeActor->SetRepresentation(SVTK::Representation::Wireframe);
}
+//----------------------------------------------------------------------------
+unsigned long int
+VISU_MeshAct
+::GetMemorySize()
+{
+ unsigned long int aSize = Superclass::GetMemorySize();
+ {
+ vtkDataSet* aDataSet = mySurfaceActor->GetMapper()->GetInput();
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+ }
+ {
+ vtkDataSet* aDataSet = myEdgeActor->GetMapper()->GetInput();
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+ }
+ {
+ vtkDataSet* aDataSet = myNodeActor->GetMapper()->GetInput();
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+ }
+ return aSize;
+}
+
//----------------------------------------------------------------------------
int
VISU_MeshAct
{
public:
vtkTypeMacro(VISU_MeshAct,VISU_Actor);
- static VISU_MeshAct* New();
+ static
+ VISU_MeshAct*
+ New();
+
+ //! Copies all properties from the given actor
+ virtual
+ void
+ DeepCopy(VISU_Actor *theActor);
//! Apply view transformation
virtual
void
UnShrink();
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
virtual
int
RenderOpaqueGeometry(vtkViewport *ren);
#include <vtkRenderer.h>
#include <vtkProperty.h>
+//----------------------------------------------------------------------------
vtkStandardNewMacro(VISU_ScalarMapAct);
+//----------------------------------------------------------------------------
VISU_ScalarMapAct
::VISU_ScalarMapAct()
{
myProperty->DeepCopy(aProperty);
}
+//----------------------------------------------------------------------------
VISU_ScalarMapAct
::~VISU_ScalarMapAct()
{
myScalarBar->Delete();
}
+//----------------------------------------------------------------------------
+void
+VISU_ScalarMapAct
+::DeepCopy(VISU_Actor *theActor)
+{
+ if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
+ Superclass::DeepCopy(theActor);
+ SetBarVisibility(anActor->GetBarVisibility());
+ SetShading(anActor->IsShading());
+ }
+}
+
+
+//----------------------------------------------------------------------------
void
VISU_ScalarMapAct
::AddToRender(vtkRenderer* theRenderer)
theRenderer->AddActor2D(myScalarBar);
}
+//----------------------------------------------------------------------------
void
VISU_ScalarMapAct
::RemoveFromRender(vtkRenderer* theRenderer)
Superclass::RemoveFromRender(theRenderer);
}
+//----------------------------------------------------------------------------
void
VISU_ScalarMapAct
::SetVisibility(int theMode)
myScalarBar->SetVisibility(myBarVisibility && theMode);
}
+//----------------------------------------------------------------------------
int
VISU_ScalarMapAct
::GetBarVisibility()
return myBarVisibility;
}
+//----------------------------------------------------------------------------
VISU_ScalarBarActor*
VISU_ScalarMapAct
::GetScalarBar()
return myScalarBar;
}
+//----------------------------------------------------------------------------
void
VISU_ScalarMapAct
::SetBarVisibility(bool theMode)
}
+//----------------------------------------------------------------------------
void
VISU_ScalarMapAct
::SetRepresentation(int theMode)
}
+//----------------------------------------------------------------------------
void
VISU_ScalarMapAct
::SetShading(bool theOn)
}
}
+//----------------------------------------------------------------------------
bool
VISU_ScalarMapAct
::IsShading()
return (aProperty->GetAmbient() == 0 && aProperty->GetDiffuse() == 1);
}
+
+//----------------------------------------------------------------------------
+unsigned long int
+VISU_ScalarMapAct
+::GetMemorySize()
+{
+ return Superclass::GetMemorySize();
+}
+
+//----------------------------------------------------------------------------
~VISU_ScalarMapAct();
+ //! Copies all properties from the given actor
+ virtual
+ void
+ DeepCopy(VISU_Actor *theActor);
+
virtual
void
AddToRender(vtkRenderer* theRenderer);
bool
IsShading();
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
protected:
VISU_ScalarMapAct();
bool myBarVisibility;
class VTKViewer_Transform;
class VISU_VectorsPL;
-class VTKOCC_EXPORT VISU_VectorsAct : public VISU_ScalarMapAct {
+class VTKOCC_EXPORT VISU_VectorsAct : public VISU_ScalarMapAct
+{
public:
vtkTypeMacro(VISU_VectorsAct,VISU_ScalarMapAct);
static int MYDEBUG = 0;
#endif
-static int INCMEMORY = 4;
-
//============================================================================
VISU::ColoredPrs3d_i::
VISU::ColoredPrs3d_i
::GetMemorySize()
{
- vtkDataSet* aDataSet = GetPipeLine()->GetMapper()->GetInput();
- vtkFloatingPointType aSize = aDataSet->GetActualMemorySize();
- vtkFloatingPointType aMemorySize = aSize * INCMEMORY / 1024.0; // in Mb
- return CORBA::Float(aMemorySize);
+ return TSuperClass::GetMemorySize();
}
VISU::ColoredPrs3dHolder::BasicInput*
std::string
GetCTitle();
+ //----------------------------------------------------------------------------
+ //! Gets memory size actually used by the presentation (Mb).
virtual
CORBA::Float
GetMemorySize();
+ //----------------------------------------------------------------------------
//! Returns presentation input
VISU::ColoredPrs3dHolder::BasicInput*
GetBasicInput();
#include "SUIT_ResourceMgr.h"
-using namespace VISU;
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
//----------------------------------------------------------------------------
VISU::Mesh_i
-::Mesh_i(Result_i* theResult) :
+::Mesh_i(VISU::Result_i* theResult) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,false),
myMeshPL(VISU_MeshPL::New())
//----------------------------------------------------------------------------
VISU::Mesh_i
-::Mesh_i(Result_i* theResult,
+::Mesh_i(VISU::Result_i* theResult,
SALOMEDS::SObject_ptr theSObject) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theSObject),
//----------------------------------------------------------------------------
void
VISU::Mesh_i
-::SameAs(const Prs3d_i* theOrigin)
+::SameAs(const VISU::Prs3d_i* theOrigin)
{
return; // "SameAs" command for mesh is not valid in current architecture
}
#include "SALOME_Event.hxx"
#include <vtkActorCollection.h>
+#include <vtkUnstructuredGrid.h>
#include <vtkDataSet.h>
#include <vtkMapper.h>
#include <boost/bind.hpp>
-using namespace VISU;
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
}
//----------------------------------------------------------------------------
-Result_i*
+VISU::Result_i*
VISU::Prs3d_i
::GetCResult() const
{
VISU::Prs3d_i
::SetResultObject(VISU::Result_ptr theResult)
{
- SetCResult(dynamic_cast<Result_i*>(GetServant(theResult).in()));
+ SetCResult(dynamic_cast<VISU::Result_i*>(GetServant(theResult).in()));
}
}
+//----------------------------------------------------------------------------
+CORBA::Float
+VISU::Prs3d_i
+::GetMemorySize()
+{
+ static int INCMEMORY = 4;
+ vtkDataSet* aDataSet = GetPipeLine()->GetInput();
+ CORBA::Float aSize = aDataSet->GetActualMemorySize() * (INCMEMORY - 1);
+
+ int anEnd = myActorCollection->GetNumberOfItems();
+ for(int anId = 0; anId < anEnd; anId++)
+ if(vtkObject* anObject = myActorCollection->GetItemAsObject(anId))
+ if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anObject))
+ aSize += anActor->GetMemorySize();
+
+ return aSize / (1024.0 * 1024.0);
+}
+
//----------------------------------------------------------------------------
VISU::Result_i*
VISU::GetResult(SALOMEDS::SObject_var theSObject)
Prs3d_i(const Prs3d_i&);
public:
+ //----------------------------------------------------------------------------
+ typedef PrsObject_i TSuperClass;
+ typedef VISU::Prs3d TInterface;
+
//----------------------------------------------------------------------------
//! A constructor to create a fresh instance of the class
Prs3d_i();
CORBA::Float& theDy,
CORBA::Float& theDz);
+ //----------------------------------------------------------------------------
+ //! Gets memory size actually used by the presentation (Mb).
+ virtual
+ CORBA::Float
+ GetMemorySize();
+
//----------------------------------------------------------------------------
//! Return modified time of the presentation
virtual