anAppendPolyData->Delete();
//Calculate values for building of table
vtkMath::Cross(aDir[0],aDir[1],myDirLn);
- for (int i=0; i<3 ; i++) {
+ for (int i = 0; i<3 ; i++) {
myRealDirLn[i] = myDirLn[i];
- if(myDirLn[i]<0) myDirLn[i] = (-1)*myDirLn[i];//enk:: correction of bug Bug PAL10401
+ if(myDirLn[i] < 0.0)
+ myDirLn[i] = -1.0*myDirLn[i];//enk:: correction of bug Bug PAL10401
}
GetBoundProject(myBoundPrjLn, aBaseBounds, myDirLn);
VISU::Mul(myDirLn,myBoundPrjLn[0],myBasePnt);
int thePlaneCondition,
vtkFloatingPointType theDisplacement);
- const vtkFloatingPointType*
- GetDirLn()
- {
- return myDirLn;
- }
-
+ //! Returns direction that is defined by position & orientation of the basic and tool planes
const vtkFloatingPointType*
GetRealDirLn()
{
return myRealDirLn;
}
+ /*!
+ Returns direction that corresponds to the myRealDirLn,
+ but has the same direction as main axis.
+ */
const vtkFloatingPointType*
- GetBoundPrjLn()
+ GetDirLn()
{
- return myBoundPrjLn;
+ return myDirLn;
}
+ /*!
+ Returns coordinates of 3D point that shows
+ where is the first intersection of the given mesh.
+ with the defined direction.
+ */
const vtkFloatingPointType*
GetBasePnt()
{
return myBasePnt;
}
+ /*!
+ Returns three floating point numbers that defines the following values:
+ 1. Distance between the initial point of intersection and origin of coordinates;
+ 2. Distance between the last point of intersection and origin of coordinates;
+ 3. Distance between the last point and initial points of intersection.
+ with the defined direction.
+ */
+ const vtkFloatingPointType*
+ GetBoundPrjLn()
+ {
+ return myBoundPrjLn;
+ }
+
protected:
vtkFloatingPointType myDirLn[3];
vtkFloatingPointType myRealDirLn[3];
}
+vtkFloatingPointType
+VISU_CutPlanesPL
+::GetDisplacement(int theNum)
+{
+ return myDisplacement[theNum];
+}
+
+
+void
+VISU_CutPlanesPL
+::SetDisplacement(vtkFloatingPointType theDisp,
+ int theNum)
+{
+ myDisplacement[theNum] = theDisp;
+ Modified();
+}
+
+
void
VISU_CutPlanesPL
::SetNbParts(int theNb)
::SetPartPosition(int thePartNumber,
vtkFloatingPointType thePartPosition)
{
- if(thePartNumber >= myNbParts) return;
+ if(thePartNumber >= myNbParts)
+ return;
myPartPosition[thePartNumber] = thePartPosition;
myPartCondition[thePartNumber] = 0;
Modified();
::GetPartPosition(int thePartNumber,
int theNum)
{
- if(thePartNumber >= myNbParts) return 0;
+ if(thePartNumber >= myNbParts)
+ return 0;
vtkFloatingPointType aPosition = myPartPosition[thePartNumber];
if(myPartCondition[thePartNumber]){
vtkFloatingPointType aDir[3], aBounds[6], aBoundPrj[3];
virtual
vtkFloatingPointType
- GetDisplacement(int theNum = 0)
- {
- return myDisplacement[theNum];
- }
+ GetDisplacement(int theNum = 0);
virtual
void
SetDisplacement(vtkFloatingPointType theDisp,
- int theNum = 0)
- {
- myDisplacement[theNum] = theDisp;
- }
+ int theNum = 0);
virtual
void
}
+//----------------------------------------------------------------------------
+unsigned long int
+VISU_GaussPointsPL
+::GetMTime()
+{
+ unsigned long int aTime = std::max(Superclass::GetMTime(),myPSMapper->GetMTime());
+ return aTime;
+}
+
//----------------------------------------------------------------------------
void
CopyGlyph( vtkGlyph3D* source, vtkGlyph3D* dest )
void
VISU_GaussPointsPL
::Build()
-{
-}
+{}
//----------------------------------------------------------------------------
void
::SetIsColored(bool theIsColored)
{
myPSMapper->SetPointSpriteMode( theIsColored ? 0 : 1 ); // Results / Geometry
- Modified();
+}
+
+//----------------------------------------------------------------------------
+bool
+VISU_GaussPointsPL
+::GetIsColored()
+{
+ return myPSMapper->GetPointSpriteMode() == 0;
}
//----------------------------------------------------------------------------
static
VISU_GaussPointsPL* New();
+ virtual
+ unsigned long int
+ GetMTime();
+
virtual
void
ShallowCopy(VISU_PipeLine *thePipeLine);
void
SetIsColored(bool theIsColored);
+ bool
+ GetIsColored();
+
//! Set type of the primitives.
void
SetPrimitiveType(int thePrimitiveType);
#include "SALOME_ExtractGeometry.h"
#include <float.h>
+#include <algorithm>
#include <vtkObjectFactory.h>
#include <vtkDataSetMapper.h>
anImplicitBoolean->Delete();
myIsShrinkable = false;
-
}
VISU_PipeLine
if(MYDEBUG) MESSAGE("VISU_PipeLine::~VISU_PipeLine - "<<this);
}
+unsigned long int
+VISU_PipeLine
+::GetMTime()
+{
+ unsigned long int aTime = std::max(Superclass::GetMTime(),myMapper->GetMTime());
+ return aTime;
+}
+
// Turn debugging output on.
void
VISU_PipeLine
VISU_PipeLine
::SetInput(TInput* theInput)
{
+ if(GetInput() == theInput)
+ return;
+
if(theInput)
theInput->Update();
myExtractGeometry->SetInput(theInput);
myInput = theInput;
-
- Modified();
}
VISU_PipeLine::TMapper*
#include <vector>
#include <vtkObject.h>
#include <vtkSmartPointer.h>
+#include <vtkTimeStamp.h>
#include "VISU_IDMapper.hxx"
class vtkDataSet;
class vtkImplicitFunction;
+
+//----------------------------------------------------------------------------
template <class T>
class TVTKSmartPtr: public vtkSmartPointer<T>
{
}
};
+
+//----------------------------------------------------------------------------
class vtkMapper;
class vtkDataSetMapper;
class vtkUnstructuredGrid;
typedef VISU::TVTKOutput TInput;
-class VISU_PipeLine : public vtkObject{
+class VISU_PipeLine : public vtkObject
+{
public:
vtkTypeMacro(VISU_PipeLine,vtkObject);
+
virtual
- ~VISU_PipeLine();
+ unsigned long int
+ GetMTime();
virtual
void
VISU_PipeLine();
VISU_PipeLine(const VISU_PipeLine&);
+ virtual
+ ~VISU_PipeLine();
+
virtual
TInput*
GetInput2() const;
return myScaleFactor;
}
+void
+VISU_Plot3DPL::
+SetContourPrs(bool theIsContourPrs )
+{
+ myIsContour = theIsContourPrs;
+ Modified();
+}
+
+bool
+VISU_Plot3DPL::
+GetIsContourPrs() const
+{
+ return myIsContour;
+}
+
void
VISU_Plot3DPL::
SetPlanePosition(vtkFloatingPointType thePosition,
{
myIsRelative = theIsRelative;
myPosition = thePosition;
+ Modified();
}
bool
case VISU_CutPlanesPL::ZX: myAngle[0] = theYAngle; break;
}
myOrientation = theOrientation;
+ Modified();
}
vtkFloatingPointType
//function : GetBasePlane
//purpose :
//=======================================================================
-
-void VISU_Plot3DPL::GetBasePlane(vtkFloatingPointType theOrigin[3],
- vtkFloatingPointType theNormal[3],
- bool theCenterOrigine ) const
+void
+VISU_Plot3DPL
+::GetBasePlane(vtkFloatingPointType theOrigin[3],
+ vtkFloatingPointType theNormal[3],
+ bool theCenterOrigine ) const
{
VISU_CutPlanesPL::GetDir(theNormal,myAngle,myOrientation);
//function : GetMinMaxPosition
//purpose : return absolute position range
//=======================================================================
-
-void VISU_Plot3DPL::GetMinMaxPosition( vtkFloatingPointType& minPos,
- vtkFloatingPointType& maxPos ) const
+void
+VISU_Plot3DPL
+::GetMinMaxPosition( vtkFloatingPointType& minPos,
+ vtkFloatingPointType& maxPos ) const
{
vtkFloatingPointType aBounds[6], aBoundPrj[3], aNormal[3];
VISU_CutPlanesPL::GetDir(aNormal,myAngle,myOrientation);
//purpose :
//=======================================================================
-void VISU_Plot3DPL::SetMapScale(vtkFloatingPointType theMapScale)
+void
+VISU_Plot3DPL
+::SetMapScale(vtkFloatingPointType theMapScale)
{
VISU_ScalarMapPL::SetMapScale(theMapScale);
GetScaleFactor() const;
void
- SetContourPrs (bool theIsContourPrs ) { myIsContour = theIsContourPrs; }
+ SetContourPrs(bool theIsContourPrs );
bool
- GetIsContourPrs() { return myIsContour; }
+ GetIsContourPrs() const;
void
SetNumberOfContours(int theNumber);
public:
vtkTypeMacro(VISU_ScalarMapOnDeformedShapePL,VISU_ScalarMapPL);
- static VISU_ScalarMapOnDeformedShapePL* New();
+ static
+ VISU_ScalarMapOnDeformedShapePL*
+ New();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
- virtual void SetScale(vtkFloatingPointType theScale);
- virtual vtkFloatingPointType GetScale();
+ virtual
+ void
+ SetScale(vtkFloatingPointType theScale);
- virtual int GetScalarMode();
- virtual void SetScalarMode(int theScalarMode = 0);
+ virtual
+ vtkFloatingPointType
+ GetScale();
- virtual void GetSourceRange(vtkFloatingPointType theRange[2]);
+ virtual
+ int
+ GetScalarMode();
- virtual void SetScalars(vtkDataSet *theScalars);
- virtual vtkUnstructuredGrid* GetScalars();
+ virtual
+ void
+ SetScalarMode(int theScalarMode = 0);
+
+ virtual
+ void
+ GetSourceRange(vtkFloatingPointType theRange[2]);
+
+ virtual
+ void
+ SetScalars(vtkDataSet *theScalars);
+
+ virtual
+ vtkUnstructuredGrid*
+ GetScalars();
public:
//! Redefined method for initialization of the pipeline.
void
UpdateScalars();
- virtual void SetMapScale(vtkFloatingPointType theMapScale = 1.0);
+ virtual
+ void
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
protected:
vtkFloatingPointType myScaleFactor;
}
+void
+VISU_VectorsPL
+::SetGlyphType(VISU_VectorsPL::GlyphType theType)
+{
+ myTypeGlyph = theType;
+ Modified();
+}
+
+VISU_VectorsPL::GlyphType
+VISU_VectorsPL
+::GetGlyphType() const
+{
+ return myTypeGlyph;
+}
+
+
+void
+VISU_VectorsPL
+::SetGlyphPos(VISU_VectorsPL::GlyphPos thePos)
+{
+ myPosGlyph = thePos;
+ Modified();
+}
+
+VISU_VectorsPL::GlyphPos
+VISU_VectorsPL
+::GetGlyphPos() const
+{
+ return myPosGlyph;
+}
+
+
void
VISU_VectorsPL
::Init()
virtual
void
- SetGlyphType(GlyphType theType)
- {
- myTypeGlyph = theType;
- }
+ SetGlyphType(GlyphType theType);
virtual
GlyphType
- GetGlyphType()
- {
- return myTypeGlyph;
- }
+ GetGlyphType() const;
enum GlyphPos{ CENTER, TAIL,HEAD};
virtual
void
- SetGlyphPos(GlyphPos thePos)
- {
- myPosGlyph = thePos;
- }
+ SetGlyphPos(GlyphPos thePos);
virtual
GlyphPos
- GetGlyphPos()
- {
- return myPosGlyph;
- }
+ GetGlyphPos() const;
public:
virtual
myCBDisplayed->setEnabled( activeLocal );
myCBDisplayed->setChecked( thePrs->GetIsDispGlobalScalarBar() );
- bool bicolor = thePrs->GetGaussPointsPL()->GetBicolor();
+ bool bicolor = thePrs->GetSpecificPL()->GetBicolor();
BicolorButton->setChecked( bicolor );
RainbowButton->setChecked( !bicolor );
ColorLabel->setEnabled( !bicolor );
thePrs->SetNbColors(ColorSpin->value());
thePrs->SetLabels(LabelSpin->value());
- thePrs->GetGaussPointsPL()->SetBicolor(BicolorButton->isChecked());
+ thePrs->GetSpecificPL()->SetBicolor(BicolorButton->isChecked());
//if (isToSave()) storeToResources();
if( myPrs && myPrimitiveBox->getPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere )
{
int aNumberOfFaces = myPrimitiveBox->getFaceNumber();
- int aNumberOfPoints = ( (vtkPolyData*)myPrs->GetGaussPointsPL()->GetInput() )->GetNumberOfCells();
+ int aNumberOfPoints = ( (vtkPolyData*)myPrs->GetSpecificPL()->GetInput() )->GetNumberOfCells();
if( aNumberOfFaces * aNumberOfPoints > myPrimitiveBox->getFaceLimit() )
{
setLogarithmic(false);
}
vtkFloatingPointType aRange[2];
- thePrs->GetScalarMapPL()->GetSourceRange(aRange);
+ thePrs->GetSpecificPL()->GetSourceRange(aRange);
Rmin = aRange[0]; Rmax = aRange[1];
setRange( thePrs->GetMin(), thePrs->GetMax(),
/*0.0, 0.0,*/ thePrs->IsRangeFixed() );
if (!check()) return;
myScalarMapPL = VISU_ScalarMapPL::New();
- if(myScalarMap->GetScalarMapPL())
- myScalarMapPL->ShallowCopy(myScalarMap->GetScalarMapPL());
+ if(myScalarMap->GetSpecificPL())
+ myScalarMapPL->ShallowCopy(myScalarMap->GetSpecificPL());
if ( myBusy ) return;
vtkFloatingPointType aRange[2];
int aMode = myScalarMap->GetScalarMode();
myScalarMap->SetScalarMode(theMode);
- myScalarMap->GetScalarMapPL()->GetSourceRange(aRange);
+ myScalarMap->GetSpecificPL()->GetSourceRange(aRange);
MinEdit->setText( QString::number( aRange[0] ) );
MaxEdit->setText( QString::number( aRange[1] ) );
myScalarMap->SetScalarMode(aMode);
void VisuGUI_ScalarMapOnDeformedShapeDlg::UpdateScalarField(){
myPrs->SetScale(getFactor());
vtkFloatingPointType aRange[2];
- myPrs->GetScalarMapOnDeformedShapePL()->Build();
- myPrs->GetScalarMapOnDeformedShapePL()->Update();
- myPrs->GetScalarMapOnDeformedShapePL()->GetSourceRange(aRange);
+ myPrs->GetSpecificPL()->Build();
+ myPrs->GetSpecificPL()->Update();
+ myPrs->GetSpecificPL()->GetSourceRange(aRange);
double aDoubleRange[2];
aDoubleRange[0] = double(aRange[0]);
aDoubleRange[1] = double(aRange[1]);
{
if(TSuperClass::SetInput()){
if(CheckIsPossible()){
- if(ApplyInput()){
+ if(OnSetInput()){
if(Create(GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber()))
return true;
}else
//---------------------------------------------------------------
bool
VISU::ColoredPrs3d_i
-::ApplyInput()
+::OnSetInput()
{
bool anIsNotCreated = GetPL() == NULL;
if(anIsNotCreated)
VISU::ColoredPrs3d_i
::SetEntity(VISU::Entity theEntity)
{
- myEntity = theEntity;
+ if(myEntity != theEntity){
+ myEntity = theEntity;
+ myParamsTime.Modified();
+ }
}
VISU::ColoredPrs3d_i
::SetFieldName(const char* theFieldName)
{
- myFieldName = theFieldName;
+ if(myFieldName != theFieldName){
+ myFieldName = theFieldName;
+ myParamsTime.Modified();
+ }
}
char*
VISU::ColoredPrs3d_i
::SetTimeStampNumber(CORBA::Long theTimeStampNumber)
{
- myTimeStampNumber = theTimeStampNumber;
+ if(myTimeStampNumber != theTimeStampNumber){
+ myTimeStampNumber = theTimeStampNumber;
+ myParamsTime.Modified();
+ }
}
CORBA::Long
SetEntity(anOrigin->GetEntity());
SetFieldName(anOrigin->GetFieldName());
SetTimeStampNumber(anOrigin->GetTimeStampNumber());
- ApplyInput();
+ OnSetInput();
Build(ESameAs);
int aTimeStampNumber = GetTimeStampNumber();
SameAs(theOrigin);
SetTimeStampNumber(aTimeStampNumber);
- ApplyInput();
+ OnSetInput();
Build(ESameAs);
Update();
VISU::ColoredPrs3d_i
::SetBarOrientation(VISU::ScalarMap::Orientation theOrientation)
{
- myOrientation = theOrientation;
+ if(myOrientation != theOrientation){
+ myOrientation = theOrientation;
+ myParamsTime.Modified();
+ }
}
VISU::ScalarMap::Orientation
{
myPosition[0] = X;
myPosition[1] = Y;
+ myParamsTime.Modified();
}
CORBA::Double
{
myWidth = theWidth;
myHeight = theHeight;
+ myParamsTime.Modified();
}
CORBA::Double
VISU::ColoredPrs3d_i
::SetLabels(CORBA::Long theNbLabels)
{
- myNumberOfLabels = theNbLabels;
+ if(myNumberOfLabels != theNbLabels){
+ myNumberOfLabels = theNbLabels;
+ myParamsTime.Modified();
+ }
}
CORBA::Long
VISU::ColoredPrs3d_i
::SetTitle(const char* theName)
{
- myTitle = theName;
+ if(myTitle != theName){
+ myTitle = theName;
+ myParamsTime.Modified();
+ }
}
char*
void
VISU::ColoredPrs3d_i
-::SetBoldTitle(bool isBold)
+::SetBoldTitle(bool theIsBoldTitle)
{
- myIsBoldTitle = isBold;
+ if(myIsBoldTitle != theIsBoldTitle){
+ myIsBoldTitle = theIsBoldTitle;
+ myParamsTime.Modified();
+ }
}
bool
void
VISU::ColoredPrs3d_i
-::SetItalicTitle(bool isItalic)
+::SetItalicTitle(bool theIsItalicTitle)
{
- myIsItalicTitle = isItalic;
+ if(myIsItalicTitle != theIsItalicTitle){
+ myIsItalicTitle = theIsItalicTitle;
+ myParamsTime.Modified();
+ }
}
bool
void
VISU::ColoredPrs3d_i
-::SetShadowTitle(bool isShadow)
+::SetShadowTitle(bool theIsShadowTitle)
{
- myIsShadowTitle = isShadow;
+ if(myIsShadowTitle != theIsShadowTitle){
+ myIsShadowTitle = theIsShadowTitle;
+ myParamsTime.Modified();
+ }
}
int
void
VISU::ColoredPrs3d_i
-::SetTitFontType(int theType)
+::SetTitFontType(int theTitFontType)
{
- myTitFontType = theType;
+ if(myTitFontType != theTitFontType){
+ myTitFontType = theTitFontType;
+ myParamsTime.Modified();
+ }
}
void
myTitleColor[0] = theR;
myTitleColor[1] = theG;
myTitleColor[2] = theB;
+ myParamsTime.Modified();
}
bool
void
VISU::ColoredPrs3d_i
-::SetBoldLabel(bool isBold)
+::SetBoldLabel(bool theIsBoldLabel)
{
- myIsBoldLabel = isBold;
+ if(myIsBoldLabel != theIsBoldLabel){
+ myIsBoldLabel = theIsBoldLabel;
+ myParamsTime.Modified();
+ }
}
bool
void
VISU::ColoredPrs3d_i
-::SetItalicLabel(bool isItalic)
+::SetItalicLabel(bool theIsItalicLabel)
{
- myIsItalicLabel = isItalic;
+ if(myIsItalicLabel != theIsItalicLabel){
+ myIsItalicLabel = theIsItalicLabel;
+ myParamsTime.Modified();
+ }
}
bool
void
VISU::ColoredPrs3d_i
-::SetShadowLabel(bool isShadow)
+::SetShadowLabel(bool theIsShadowLabel)
{
- myIsShadowLabel = isShadow;
+ if(myIsShadowLabel != theIsShadowLabel){
+ myIsShadowLabel = theIsShadowLabel;
+ myParamsTime.Modified();
+ }
}
int
void
VISU::ColoredPrs3d_i
-::SetLblFontType(int theType)
+::SetLblFontType(int theLblFontType)
{
- myLblFontType = theType;
+ if(myIsShadowLabel != theLblFontType){
+ myLblFontType = theLblFontType;
+ myParamsTime.Modified();
+ }
}
void
myLabelColor[0] = theR;
myLabelColor[1] = theG;
myLabelColor[2] = theB;
+ myParamsTime.Modified();
}
SetEntity(theEntity);
SetFieldName(theFieldName);
SetTimeStampNumber(theTimeStampNumber);
- ApplyInput();
+ OnSetInput();
Build(ECreateNew); // to get corresponding input from result and initilize the pipeline
SetEntity((VISU::Entity)VISU::Storable::FindValue(theMap,"myEntity").toInt());
SetFieldName(VISU::Storable::FindValue(theMap,"myFieldName").latin1());
SetTimeStampNumber(VISU::Storable::FindValue(theMap,"myIteration").toInt());
- ApplyInput();
+ OnSetInput();
myAddToStudy = false; //SRN Added 21/06/2003 SAL2983: to avoid addition of the new ScalarMap to study.
{
return VISU::TEntity(int(myEntity));
}
-
-VISU_ScalarMapPL*
-VISU::ColoredPrs3d_i
-::GetScalarMapPL()
-{
- return myScalarMapPL;
-}
virtual const VISU::PField&
GetField() const;
- VISU_ScalarMapPL*
- GetScalarMapPL();
-
virtual
bool
IsBoldTitle();
*/
virtual
bool
- ApplyInput();
+ OnSetInput();
/*!
Sets input data set according to basic input parameters -
}
+//---------------------------------------------------------------
+CORBA::Boolean
+VISU::DeformedShape_i
+::IsColored()
+{
+ return myIsColored;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShape_i
+::ShowColored(CORBA::Boolean theColored)
+{
+ myIsColored = theColored;
+ myParamsTime.Modified();
+}
+
+//---------------------------------------------------------------
+SALOMEDS::Color
+VISU::DeformedShape_i
+::GetColor()
+{
+ return myColor;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShape_i
+::SetColor(const SALOMEDS::Color& theColor)
+{
+ myColor = theColor;
+ myParamsTime.Modified();
+}
+
+
//---------------------------------------------------------------
void
VISU::DeformedShape_i
virtual
CORBA::Boolean
- IsColored()
- {
- return myIsColored;
- }
+ IsColored();
virtual
void
- ShowColored(CORBA::Boolean theColored)
- {
- myIsColored = theColored;
- }
+ ShowColored(CORBA::Boolean theColored);
virtual
- SALOMEDS::Color GetColor()
- {
- return myColor;
- }
+ SALOMEDS::Color
+ GetColor();
virtual
void
- SetColor(const SALOMEDS::Color& theColor)
- {
- myColor = theColor;
- }
+ SetColor(const SALOMEDS::Color& theColor);
typedef VISU::DeformedShape TInterface;
VISU::GaussPoints_i::
GaussPoints_i(Result_i* theResult,
bool theAddToStudy) :
- PrsObject_i(theResult->GetStudyDocument()),
+ PrsObject_i(SALOMEDS::Study::_nil()),
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
myGaussPointsPL(NULL),
- myIsColored(true),
myColor(Qt::blue),
myIsActiveLocalScalarBar(true),
myIsDispGlobalScalarBar(true),
VISU::GaussPoints_i::
GaussPoints_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject) :
- PrsObject_i(theResult->GetStudyDocument()),
+ PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
myGaussPointsPL(NULL),
- myIsColored(true),
myColor(Qt::blue),
myIsActiveLocalScalarBar(true),
myIsDispGlobalScalarBar(true),
//----------------------------------------------------------------------------
-VISU_GaussPointsPL*
-VISU::GaussPoints_i
-::GetGaussPointsPL()
-{
- return myGaussPointsPL;
-}
-
void
VISU::GaussPoints_i
::SetIsDeformed( bool theIsDeformed )
VISU::GaussPoints_i
::SetIsColored( bool theIsColored )
{
- myIsColored = theIsColored;
myGaussPointsPL->SetIsColored( theIsColored );
}
+bool
+VISU::GaussPoints_i
+::GetIsColored()
+{
+ return myGaussPointsPL->GetIsColored();
+}
+
bool
VISU::GaussPoints_i
::SetMainTexture( const QString& theMainTexture )
aRangeGlobal[0] = aTMinMax.first;
aRangeGlobal[1] = aTMinMax.second;
- GetGaussPointsPL()->GetMapper()->SetScalarRange(aRangeGlobal);
+ GetSpecificPL()->GetMapper()->SetScalarRange(aRangeGlobal);
}
aScalarBarCtrl->SetMode(aScalarBarMode);
aScalarBarCtrl->SetSpacing(mySpacing);
// Bicolor
- bool anIsBicolor = GetGaussPointsPL()->GetBicolor();
+ bool anIsBicolor = GetSpecificPL()->GetBicolor();
aScalarBarCtrl->SetBicolor(anIsBicolor);
UpdateScalarBar(aScalarBarCtrl->GetLocalBar(),
myColor.blue() / 255.0);
}
- if( GetGaussPointsPL()->GetPrimitiveType() != VISU_OpenGLPointSpriteMapper::GeomSphere )
+ if( GetSpecificPL()->GetPrimitiveType() != VISU_OpenGLPointSpriteMapper::GeomSphere )
theActor->SetRepresentation( VTK_POINTS );
else
theActor->SetRepresentation( VTK_SURFACE );
//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::SetIsActiveLocalScalarBar(const bool theFlag)
+::SetIsActiveLocalScalarBar(const bool theIsActiveLocalScalarBar)
{
- myIsActiveLocalScalarBar = theFlag;
+ if(myIsActiveLocalScalarBar != theIsActiveLocalScalarBar){
+ myIsActiveLocalScalarBar = theIsActiveLocalScalarBar;
+ myParamsTime.Modified();
+ }
}
bool
void
VISU::GaussPoints_i
-::SetIsDispGlobalScalarBar(const bool theFlag)
+::SetIsDispGlobalScalarBar(const bool theIsDispGlobalScalarBar)
{
- myIsDispGlobalScalarBar=theFlag;
+ if(myIsDispGlobalScalarBar != theIsDispGlobalScalarBar){
+ myIsDispGlobalScalarBar = theIsDispGlobalScalarBar;
+ myParamsTime.Modified();
+ }
}
bool
VISU::GaussPoints_i
::SetBiColor(bool theIsBiColor)
{
- GetGaussPointsPL()->SetBicolor(theIsBiColor);
+ GetSpecificPL()->SetBicolor(theIsBiColor);
}
bool
VISU::GaussPoints_i
::GetBiColor()
{
- return GetGaussPointsPL()->GetBicolor();
+ return GetSpecificPL()->GetBicolor();
}
void
::SetSpacing(const vtkFloatingPointType theSpacing)
{
mySpacing = theSpacing;
+ myParamsTime.Modified();
}
vtkFloatingPointType
typedef VISU::GaussPoints TInterface;
- //! Get the Gauss Points Pipeline.
- VISU_GaussPointsPL*
- GetGaussPointsPL();
-
int
GetFaceLimit() { return myFaceLimit; }
//! Get flag indicating which mode of the presentation is active.
/*! When Results mode is active, returns true. Geometry - false. */
bool
- GetIsColored() { return myIsColored; }
+ GetIsColored();
//! Get flag indicating which mode of the presentation is active.
void
protected:
VISU_GaussPointsPL *myGaussPointsPL;
- bool myIsColored;
bool myIsDispGlobalScalarBar;
bool myIsActiveLocalScalarBar;
QColor myColor;
return VISU::CreatePrs3d<CutPlanes_i>(theStudy);
case TCUTLINES:
return VISU::CreatePrs3d<CutLines_i>(theStudy);
+ case TVECTORS:
+ return VISU::CreatePrs3d<Vectors_i>(theStudy);
}
return Prs3d::_nil();
}
aResult->Register();
SetStudyDocument(aResult->GetStudyDocument());
myResult = aResult;
- myInputTimeStamp.Modified();
+ myParamsTime.Modified();
}
}
::SetMeshName(const char* theMeshName)
{
if(myMeshName != theMeshName){
- myMeshName == theMeshName;
- myInputTimeStamp.Modified();
+ myMeshName = theMeshName;
+ myParamsTime.Modified();
}
}
VISU::Prs3d_i
::GetMTime()
{
- return max(GetInputMTime(),GetParamsMTime());
-}
-
-//----------------------------------------------------------------------------
-unsigned long int
-VISU::Prs3d_i
-::GetInputMTime()
-{
- return myInputTimeStamp.GetMTime();
-}
-
-//----------------------------------------------------------------------------
-unsigned long int
-VISU::Prs3d_i
-::GetParamsMTime()
-{
- return myParamsTimeStamp.GetMTime();
+ unsigned long int aTime = myParamsTime.GetMTime();
+ if(myPipeLine)
+ aTime = std::max(aTime,myPipeLine->GetMTime());
+ return aTime;
}
//----------------------------------------------------------------------------
myOffset[0] = VISU::Storable::FindValue(theMap,"myOffset[0]").toFloat();
myOffset[1] = VISU::Storable::FindValue(theMap,"myOffset[1]").toFloat();
myOffset[2] = VISU::Storable::FindValue(theMap,"myOffset[2]").toFloat();
- myParamsTimeStamp.Modified();
+ myParamsTime.Modified();
return this;
}
VISU::Prs3d_i
::Update()
{
+ if(GetMTime() < myUpdateTime.GetMTime())
+ return;
+
if(MYDEBUG) MESSAGE("Prs3d_i::Update - this = "<<this);
+
try{
- if(myPipeLine)
+ if(myPipeLine){
myPipeLine->Update();
+ myUpdateTime.Modified();
+ }
+ } catch(std::exception&){
+ throw;
}catch(...){
throw std::runtime_error("Prs3d_i::Update >> unexpected exception was caught!!!");
}
VISU::Prs3d_i
::CheckDataSet()
{
+ if(GetMTime() < myUpdateTime.GetMTime())
+ return;
+
vtkMapper *aMapper = myPipeLine->GetMapper();
vtkDataSet *aDataSet = aMapper->GetInput();
if (!aDataSet)
throw std::runtime_error("There is no input data !!!");
+
aDataSet->Update();
static float eps = VTK_LARGE_FLOAT * 0.1 ;
if (!aDataSet->GetNumberOfCells())
throw std::runtime_error("There are no visible elements");
+
if (aDataSet->GetLength() > eps)
throw std::runtime_error("Diagonal of the actor is too large !!!");
}
myActorCollection->AddItem(theActor);
theActor->Delete();
-
}catch(std::bad_alloc& ex){
throw std::runtime_error("CreateActor >> No enough memory");
throw ex;
VISU::Prs3d_i
::UpdateActor(VISU_Actor* theActor)
{
+ if(theActor->GetMTime() < myUpdateTime.GetMTime())
+ return;
+
if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor - this = "<<this<<"; theActor = "<<theActor);
+
theActor->ShallowCopyPL(myPipeLine);
theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
theActor->Modified();
void
VISU::Prs3d_i
-::SetPlaneParam (vtkFloatingPointType theDir[3],
- vtkFloatingPointType theDist,
- vtkPlane* thePlane)
+::SetPlaneParam(vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theDist,
+ vtkPlane* thePlane)
{
myPipeLine->SetPlaneParam(theDir, theDist, thePlane);
}
myOffset[0] = theOffsets[0];
myOffset[1] = theOffsets[1];
myOffset[2] = theOffsets[2];
- myParamsTimeStamp.Modified();
+ myParamsTime.Modified();
}
void
myOffset[0] = theDx;
myOffset[1] = theDy;
myOffset[2] = theDz;
- myParamsTimeStamp.Modified();
+ myParamsTime.Modified();
}
void
CORBA::Float& theDz);
//----------------------------------------------------------------------------
- //! Return modified time of the object
+ //! Return modified time of the presentation
virtual
unsigned long int
GetMTime();
- //! Return input's modified time
- virtual
- unsigned long int
- GetInputMTime();
-
- //! Return params's modified time
- virtual
- unsigned long int
- GetParamsMTime();
-
protected:
virtual
bool
CheckDataSet();
protected:
+ vtkTimeStamp myUpdateTime;
+
Result_i *myResult;
std::string myMeshName;
- vtkTimeStamp myInputTimeStamp;
CORBA::Float myOffset[3];
- vtkTimeStamp myParamsTimeStamp;
+ vtkTimeStamp myParamsTime;
- bool myAddToStudy;
VISU_PipeLine *myPipeLine;
+
SALOMEDS::SObject_var mySObject;
+ bool myAddToStudy;
boost::signal0<void> myUpdateActorsSignal;
boost::signal0<void> myRemoveActorsFromRendererSignal;
}
+//---------------------------------------------------------------
+CORBA::Boolean
+VISU::ScalarMapOnDeformedShape_i
+::IsColored()
+{
+ return myIsColored;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::ShowColored(CORBA::Boolean theColored)
+{
+ myIsColored = theColored;
+ myParamsTime.Modified();
+}
+
+//---------------------------------------------------------------
+SALOMEDS::Color
+VISU::ScalarMapOnDeformedShape_i
+::GetColor()
+{
+ return myColor;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetColor(const SALOMEDS::Color& theColor)
+{
+ myColor = theColor;
+ myParamsTime.Modified();
+}
+
+
//---------------------------------------------------------------
void
VISU::ScalarMapOnDeformedShape_i
int theIteration,
VISU::TEntity theEntity)
{
- myScalarField = myResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
- TVTKOutput* aOut = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,
- theEntity,
- theFieldName,
- theIteration)->GetVTKOutput();
- if (myScalarMapOnDeformedShapePL){
- myScalarMapOnDeformedShapePL->SetScalars(aOut);
- }
+ VISU::Result_i::TInput* anInput = myResult->GetInput();
+ myScalarField = anInput->GetField(theMeshName,theEntity,theFieldName);
+ VISU::PIDMapper anIDMapper = anInput->GetTimeStampOnMesh(theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration);
+ TVTKOutput* anOutput = anIDMapper->GetVTKOutput();
+ if(myScalarMapOnDeformedShapePL && anOutput)
+ myScalarMapOnDeformedShapePL->SetScalars(anOutput);
+
this->SetScalarMeshName(theMeshName);
this->SetScalarFieldName(theFieldName);
this->SetScalarIteration(theIteration);
VISU::ScalarMapOnDeformedShape_i
::SetScalarMeshName(const char* theName)
{
- myScalarMeshName = theName;
+ if(myScalarMeshName != theName){
+ myScalarMeshName = theName;
+ myParamsTime.Modified();
+ }
}
//---------------------------------------------------------------
VISU::ScalarMapOnDeformedShape_i
::SetScalarFieldName(const char* theName)
{
- myScalarFieldName = theName;
+ if(myScalarFieldName != theName){
+ myScalarFieldName = theName;
+ myParamsTime.Modified();
+ }
}
+
//---------------------------------------------------------------
std::string
VISU::ScalarMapOnDeformedShape_i
VISU::ScalarMapOnDeformedShape_i
::SetScalarIteration(const int theValue)
{
- myScalarIteration = theValue;
+ if(myScalarIteration != theValue){
+ myScalarIteration = theValue;
+ myParamsTime.Modified();
+ }
}
VISU::ScalarMapOnDeformedShape_i
::SetScalarEntity(const VISU::TEntity theValue)
{
- myScalarEntity = theValue;
+ if(myScalarEntity != theValue){
+ myScalarEntity = theValue;
+ myParamsTime.Modified();
+ }
}
//---------------------------------------------------------------
VISU::ScalarMapOnDeformedShape_i
::SetScalarEEntity(const VISU::Entity theValue)
{
- myScalarEntity = VISU::TEntity(theValue);
+ VISU::TEntity anEntity = VISU::TEntity(theValue);
+ if(myScalarEntity != anEntity){
+ myScalarEntity = anEntity;
+ myParamsTime.Modified();
+ }
}
//---------------------------------------------------------------
virtual
CORBA::Boolean
- IsColored()
- {
- return myIsColored;
- }
+ IsColored();
virtual
void
- ShowColored(CORBA::Boolean theColored)
- {
- myIsColored = theColored;
- }
+ ShowColored(CORBA::Boolean theColored);
virtual
SALOMEDS::Color
- GetColor()
- {
- return myColor;
- }
+ GetColor();
virtual
void
- SetColor(const SALOMEDS::Color& theColor)
- {
- myColor = theColor;
- }
+ SetColor(const SALOMEDS::Color& theColor);
virtual
void
typedef VISU::ScalarMapOnDeformedShape TInterface;
VISU_ScalarMapOnDeformedShapePL*
- GetScalarMapOnDeformedShapePL()
+ GetSpecificPL()
{
return myScalarMapOnDeformedShapePL;
}
myAppendFilter->AddInput(aPrs3di->GetPL()->GetMapper()->GetInput());
aSource = myAppendFilter->GetOutput();
}
- int isAccepted = myStreamLinesPL->SetParams(theIntStep,
- thePropogationTime,
- theStepLength,
- aSource,
- thePercents,
- theDirection,
- 1);
- if(isAccepted == 1) SetSource(aPrs3di);
- return isAccepted == 1;
+ int anIsAccepted = myStreamLinesPL->SetParams(theIntStep,
+ thePropogationTime,
+ theStepLength,
+ aSource,
+ thePercents,
+ theDirection,
+ 1);
+ if(anIsAccepted == 1)
+ SetSource(aPrs3di);
+ return anIsAccepted == 1;
}
SALOMEDS::SObject_var aSObject = thePrs3d->GetSObject();
CORBA::String_var aString = aSObject->GetID();
mySourceEntry = aString.in();
+ myParamsTime.Modified();
}
}
VISU::StreamLines_i
::SetSource()
{
- if(!myStreamLinesPL->GetSource() && mySourceEntry == "") return;
- if(myStreamLinesPL->GetSource() == myAppendFilter->GetOutput()) return;
+ if(!myStreamLinesPL->GetSource() && mySourceEntry == "")
+ return;
+ if(myStreamLinesPL->GetSource() == myAppendFilter->GetOutput())
+ return;
VISU::Prs3d_var aPrs3d = GetSource();
SetParams(GetIntegrationStep(),
GetPropagationTime(),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
DeformedShape_i(theResult,theAddToStudy),
+ myLineWidth(1.0),
myVectorsPL(NULL)
{}
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
DeformedShape_i(theResult,theSObject),
+ myLineWidth(1.0),
myVectorsPL(NULL)
{}
const char* theFieldName,
int theTimeStampNumber)
{
- myLineWidth = 1.0;
return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
}
::SetLineWidth(CORBA::Double theWidth)
{
myLineWidth = theWidth;
+ myParamsTime.Modified();
}
//---------------------------------------------------------------
EXPORT_PYSCRIPTS = libVISU_Swig.py batchmode_visu.py batchmode_visu_table.py batchmode_visu_view3d.py \
visu_med.py visu_view3d.py visu.py visu_gui.py visu_prs_example.py \
visu_table.py visu_big_table.py visu_view.py visu_delete.py \
- visu_swig_test.py visu_split_views.py \
+ visu_swig_test.py visu_split_views.py visu_change_input.py \
VISU_Example_01.py VISU_Example_02.py VISU_Example_03.py VISU_Example_04.py \
VISU_Example_05.py VISU_Example_06.py VISU_Example_07.py
EXPORT_SHAREDPYSCRIPTS = VISU_shared_modules.py