Superclass::Init();
vtkDataSet* aDataSet = GetParentMesh();
-
vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
vtkFloatingPointType* aScalarRange = GetScalarRange();
#include "VISUPipeline.hxx"
+#include "VTKViewer.h"
+
class VISU_UnScaledActor: public vtkFollower
{
aVertex.vy = aCoords[1];
aVertex.vz = aCoords[2];
- int aRed, aGreen, aBlue;
+ int aRed = 0, aGreen = 0, aBlue = 0;
if( theColors && this->PointSpriteMode != 1 )
{
unsigned char *col = theColors->GetPointer(pts[0] << 2);
#endif
-namespace VISU{
- VISU_PIPELINE_EXPORT void Mul(const float A[3], float b, float C[3]); // C = A * b
- VISU_PIPELINE_EXPORT void Sub(const float A[3], const float B[3], float C[3]); // C = A - B
+namespace VISU
+{
+ void
+ Mul(const vtkFloatingPointType A[3],
+ vtkFloatingPointType b,
+ vtkFloatingPointType C[3]); // C = A * b
+
+ void
+ Sub(const vtkFloatingPointType A[3],
+ const vtkFloatingPointType B[3],
+ vtkFloatingPointType C[3]); // C = A - B
template<class TItem>
void
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_PipeLine.cxx
{
theDataSet->Update();
- float aBounds[6];
+ vtkFloatingPointType aBounds[6];
theDataSet->GetBounds(aBounds);
- float aDelta[3] = {aBounds[1] - aBounds[0], aBounds[3] - aBounds[2], aBounds[5] - aBounds[4]};
+ vtkFloatingPointType aDelta[3] = {aBounds[1] - aBounds[0], aBounds[3] - aBounds[2], aBounds[5] - aBounds[4]};
if(aDelta[0] >= aDelta[1] && aDelta[0] >= aDelta[2])
if(aDelta[1] >= aDelta[2])
return VISU_CutPlanesPL::XY;
}
-float
+vtkFloatingPointType
VISU_Plot3DPL::
GetScaleFactor(vtkDataSet* theDataSet)
{
theDataSet->Update();
- float aLength = theDataSet->GetLength(); // diagonal length
+ vtkFloatingPointType aLength = theDataSet->GetLength(); // diagonal length
- float aScalarRange[2];
+ vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
- static float EPS = 0.3;
- float aRange = aScalarRange[1];
+ static vtkFloatingPointType EPS = 0.3;
+ vtkFloatingPointType aRange = aScalarRange[1];
if(aRange > 0.0)
return aLength / aRange * EPS;
VISU_Plot3DPL::
Update()
{
- float aPlaneNormal[3];
- float anOrigin[3];
+ vtkFloatingPointType aPlaneNormal[3];
+ vtkFloatingPointType anOrigin[3];
GetBasePlane( anOrigin, aPlaneNormal );
vtkPolyData* aPolyData = 0;
}else
myContourFilter->SetInput(aPolyData);
- float aScalarRange[2];
+ vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
myContourFilter->GenerateValues(GetNumberOfContours(),aScalarRange);
void
VISU_Plot3DPL::
-SetScaleFactor(float theScaleFactor)
+SetScaleFactor(vtkFloatingPointType theScaleFactor)
{
myScaleFactor = theScaleFactor;
myWarpScalar->SetScaleFactor(theScaleFactor);
}
-float
+vtkFloatingPointType
VISU_Plot3DPL::
GetScaleFactor() const
{
void
VISU_Plot3DPL::
-SetPlanePosition(float thePosition,
+SetPlanePosition(vtkFloatingPointType thePosition,
bool theIsRelative)
{
myIsRelative = theIsRelative;
}
-float
+vtkFloatingPointType
VISU_Plot3DPL::
GetRotateX()
{
return 0;
}
-float
+vtkFloatingPointType
VISU_Plot3DPL::
GetRotateY(){
switch(myOrientation){
void
VISU_Plot3DPL::
SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
- float theXAngle,
- float theYAngle)
+ vtkFloatingPointType theXAngle,
+ vtkFloatingPointType theYAngle)
{
switch(theOrientation){
case VISU_CutPlanesPL::XY: myAngle[0] = theXAngle; break;
myOrientation = theOrientation;
}
-float
+vtkFloatingPointType
VISU_Plot3DPL::
GetPlanePosition() const
{
//purpose :
//=======================================================================
-void VISU_Plot3DPL::GetBasePlane(float theOrigin[3],
- float theNormal[3],
+void VISU_Plot3DPL::GetBasePlane(vtkFloatingPointType theOrigin[3],
+ vtkFloatingPointType theNormal[3],
bool theCenterOrigine ) const
{
VISU_CutPlanesPL::GetDir(theNormal,myAngle,myOrientation);
- float aPosition = myPosition;
- float aBounds[6], aBoundPrj[3];
+ vtkFloatingPointType aPosition = myPosition;
+ vtkFloatingPointType aBounds[6], aBoundPrj[3];
if ( myIsRelative )
{
GetInput()->GetBounds(aBounds);
if ( theCenterOrigine ) {
// move theOrigin to the center of aBounds projections to the plane
GetInput2()->GetBounds(aBounds);
- float boundPoints[8][3] = {
+ vtkFloatingPointType boundPoints[8][3] = {
{aBounds[0],aBounds[2],aBounds[4]},
{aBounds[1],aBounds[2],aBounds[4]},
{aBounds[0],aBounds[3],aBounds[4]},
{aBounds[1],aBounds[2],aBounds[5]},
{aBounds[0],aBounds[3],aBounds[5]},
{aBounds[1],aBounds[3],aBounds[5]}};
- float newOrigin[3] = { 0,0,0 };
+ vtkFloatingPointType newOrigin[3] = { 0,0,0 };
for(int i = 0; i < 8; i++) {
- float proj[3];
+ vtkFloatingPointType proj[3];
vtkPlane::ProjectPoint( boundPoints[i], theOrigin, theNormal, proj );
newOrigin[0] += proj[0];
newOrigin[1] += proj[1];
//purpose : return absolute position range
//=======================================================================
-void VISU_Plot3DPL::GetMinMaxPosition( float& minPos, float& maxPos ) const
+void VISU_Plot3DPL::GetMinMaxPosition( vtkFloatingPointType& minPos,
+ vtkFloatingPointType& maxPos ) const
{
- float aBounds[6], aBoundPrj[3], aNormal[3];
+ vtkFloatingPointType aBounds[6], aBoundPrj[3], aNormal[3];
VISU_CutPlanesPL::GetDir(aNormal,myAngle,myOrientation);
GetInput()->GetBounds(aBounds);
VISU_CutPlanesPL::GetBoundProject(aBoundPrj,aBounds,aNormal);
//purpose :
//=======================================================================
-void VISU_Plot3DPL::SetMapScale(float theMapScale)
+void VISU_Plot3DPL::SetMapScale(vtkFloatingPointType theMapScale)
{
VISU_ScalarMapPL::SetMapScale(theMapScale);
if ( myIsContour ) {
- float aRange[2];
+ vtkFloatingPointType aRange[2];
GetSourceRange(aRange);
- float aNewRange[] = { aRange[1] - theMapScale*(aRange[1]-aRange[0]), aRange[1] };
+ vtkFloatingPointType aNewRange[] = { aRange[1] - theMapScale*(aRange[1]-aRange[0]), aRange[1] };
myContourFilter->GenerateValues(GetNumberOfContours(),aNewRange);
}
myWarpScalar->SetScaleFactor(myScaleFactor*theMapScale);
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_CutPlanesPL.hxx
VISU_CutPlanesPL::PlaneOrientation
GetPlaneOrientation() const;
- float
+ vtkFloatingPointType
GetRotateX();
- float
+ vtkFloatingPointType
GetRotateY();
void
SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
- float theXAngle = 0.0,
- float theYAngle = 0.0);
+ vtkFloatingPointType theXAngle = 0.0,
+ vtkFloatingPointType theYAngle = 0.0);
- float
+ vtkFloatingPointType
GetPlanePosition() const;
bool
IsPositionRelative() const;
void
- SetPlanePosition(float thePosition,
+ SetPlanePosition(vtkFloatingPointType thePosition,
bool theIsRelative);
void
- SetScaleFactor(float theScaleFactor);
+ SetScaleFactor(vtkFloatingPointType theScaleFactor);
- float
+ vtkFloatingPointType
GetScaleFactor() const;
void
int
GetNumberOfContours() const;
- void GetBasePlane (float theOrigin[3],
- float theNormal[3],
+ void GetBasePlane (vtkFloatingPointType theOrigin[3],
+ vtkFloatingPointType theNormal[3],
bool theCenterOrigine = false ) const;
- void GetMinMaxPosition( float& minPos, float& maxPos ) const;
+ void GetMinMaxPosition( vtkFloatingPointType& minPos,
+ vtkFloatingPointType& maxPos ) const;
public:
virtual void Init();
VISU_CutPlanesPL::PlaneOrientation
GetOrientation(vtkDataSet* theDataSet);
- float
+ vtkFloatingPointType
GetScaleFactor(vtkDataSet* theDataSet);
- void SetMapScale(float theMapScale);
+ void SetMapScale(vtkFloatingPointType theMapScale);
protected:
virtual THook* DoHook();
- float myAngle[3];
+ vtkFloatingPointType myAngle[3];
bool myIsRelative, myIsContour;
- float myPosition, myScaleFactor;
+ vtkFloatingPointType myPosition, myScaleFactor;
VISU_CutPlanesPL::PlaneOrientation myOrientation;
TVTKSmartPtr<vtkCellDataToPointData> myCellDataToPointData;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_PipeLine.hxx
// we hard code how many steps to display
int numColors = this->MaximumNumberOfColors;
- float *range = lut->GetRange();
+ vtkFloatingPointType *range = lut->GetRange();
int numPts = 2*(numColors + 1);
vtkPoints *pts = vtkPoints::New();
this->NumberOfLabelsBuilt = this->NumberOfLabels;
// generate points
- float x[3]; x[2] = 0.0;
- float delta, val;
+ vtkFloatingPointType x[3]; x[2] = 0.0;
+ vtkFloatingPointType delta, val;
if ( this->Orientation == VTK_ORIENT_VERTICAL )
{
barWidth = size[0] - 4 - labelSize[0];
barHeight = (int)(0.86*size[1]);
- delta=(float)barHeight/numColors;
+ delta=(vtkFloatingPointType)barHeight/numColors;
for (i=0; i<numPts/2; i++)
{
x[0] = 0;
{
barWidth = size[0];
barHeight = (int)(0.4*size[1]);
- delta=(float)barWidth/numColors;
+ delta=(vtkFloatingPointType)barWidth/numColors;
for (i=0; i<numPts/2; i++)
{
x[0] = i*delta;
polys->InsertNextCell(4,ptIds);
if ( isLogTable ){ //SALOME specific
- float rgbval = log10(range[0]) +
+ vtkFloatingPointType rgbval = log10(range[0]) +
i*(log10(range[1])-log10(range[0]))/(numColors -1);
rgba = lut->MapValue(rgbval);
}else{
rgba = lut->MapValue(range[0] + (range[1] - range[0])*
- ((float)i /(numColors-1.0)));
+ ((vtkFloatingPointType)i /(numColors-1.0)));
}
rgb = colors->GetPointer(3*i); //write into array directly
for (i=0; i < this->NumberOfLabels; i++)
{
- val = (float)i/(this->NumberOfLabels-1) *barHeight;
+ val = (vtkFloatingPointType)i/(this->NumberOfLabels-1) *barHeight;
this->TextMappers[i]->GetSize(viewport,sizeTextData);
this->TextMappers[i]->GetTextProperty()->SetJustificationToLeft();
this->TextActors[i]->SetPosition(barWidth+3,
for (i=0; i < this->NumberOfLabels; i++)
{
this->TextMappers[i]->GetTextProperty()->SetJustificationToCentered();
- val = (float)i/(this->NumberOfLabels-1) * barWidth;
+ val = (vtkFloatingPointType)i/(this->NumberOfLabels-1) * barWidth;
this->TextActors[i]->SetPosition(val, barHeight + 0.05*size[1]);
}
}
void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size,
vtkViewport *viewport,
- float *range)
+ vtkFloatingPointType *range)
{
labelSize[0] = labelSize[1] = 0;
char string[512];
- float val;
+ vtkFloatingPointType val;
int i;
// TODO: this should be optimized, maybe by keeping a list of
this->TextMappers[i] = vtkTextMapper::New();
if(isLogTable && 0 < i && i < this->NumberOfLabels - 1){ // SALOME specific
- float lval = log10(range[0]) + (float)i/(this->NumberOfLabels-1) *
+ vtkFloatingPointType lval = log10(range[0]) + (vtkFloatingPointType)i/(this->NumberOfLabels-1) *
(log10(range[1])-log10(range[0]));
val = pow((double)10,(double)lval);
}else{
- val = range[0] + (float)i/(this->NumberOfLabels-1) * (range[1]-range[0]);
+ val = range[0] + (vtkFloatingPointType)i/(this->NumberOfLabels-1) * (range[1]-range[0]);
}
sprintf(string, this->LabelFormat, val);
this->TextMappers[i]->SetInput(string);
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_PipeLine.hxx
vtkTextMapper **TextMappers;
virtual void AllocateAndSizeLabels(int *labelSize, int *size,
- vtkViewport *viewport, float *range);
+ vtkViewport *viewport, vtkFloatingPointType *range);
private:
vtkTextMapper *TitleMapper;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_ScalarBarCtrl.cxx
inline
void
MarkValueByColor(vtkLookupTable* theTable,
- float theValue,
+ vtkFloatingPointType theValue,
unsigned char* theColor)
{
vtkIdType anIndex = theTable->GetIndex(theValue);
unsigned char aRedPtr[3] = {255, 0, 0};
unsigned char aBluePtr[3] = {0, 0, 255};
- float aRange[2];
+ vtkFloatingPointType aRange[2];
theTable->GetTableRange(aRange);
vtkIdType aNbColors = theTable->GetNumberOfColors();
- float aDelta = (aRange[1]-aRange[0])/aNbColors;
- float aValue = aRange[0]+0.5*aDelta;
+ vtkFloatingPointType aDelta = (aRange[1]-aRange[0])/aNbColors;
+ vtkFloatingPointType aValue = aRange[0]+0.5*aDelta;
for(int i = 0; i < aNbColors; i++){
vtkIdType anIndex = theTable->GetIndex(aValue);
unsigned char* aTablePtr = theTable->GetPointer(anIndex);
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetRangeLocal(float *theRange)
+::SetRangeLocal(vtkFloatingPointType *theRange)
{
myLocalLookupTable->SetTableRange(theRange);
}
void
VISU_ScalarBarCtrl
-::SetRangeLocal(float theMin,
- float theMax)
+::SetRangeLocal(vtkFloatingPointType theMin,
+ vtkFloatingPointType theMax)
{
myLocalLookupTable->SetTableRange(theMin,theMax);
}
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetRangeGlobal(float *theRange)
+::SetRangeGlobal(vtkFloatingPointType *theRange)
{
myGlobalLookupTable->SetTableRange(theRange);
}
void
VISU_ScalarBarCtrl
-::SetRangeGlobal(float theMin,
- float theMax)
+::SetRangeGlobal(vtkFloatingPointType theMin,
+ vtkFloatingPointType theMax)
{
myGlobalLookupTable->SetTableRange(theMin,theMax);
}
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetWidth(float theWidth)
+::SetWidth(vtkFloatingPointType theWidth)
{
myGlobalScalarBar->SetWidth(theWidth);
myLocalScalarBar->SetWidth(theWidth);
}
-float
+vtkFloatingPointType
VISU_ScalarBarCtrl
::GetWidth() const
{
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetHeight(float theHeight)
+::SetHeight(vtkFloatingPointType theHeight)
{
myGlobalScalarBar->SetHeight(theHeight);
myLocalScalarBar->SetHeight(theHeight);
}
-float
+vtkFloatingPointType
VISU_ScalarBarCtrl
::GetHeight() const
{
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetPosition(const float* thePosition)
+::SetPosition(const vtkFloatingPointType* thePosition)
{
myPosition[0] = thePosition[0];
myPosition[1] = thePosition[1];
}
-const float*
+const vtkFloatingPointType*
VISU_ScalarBarCtrl::GetPosition() const
{
return myPosition;
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetSpacing(const float theSpacing)
+::SetSpacing(const vtkFloatingPointType theSpacing)
{
myDistance = theSpacing;
}
-float
+vtkFloatingPointType
VISU_ScalarBarCtrl
::GetSpacing() const
{
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetMarkValue(const float theValue)
+::SetMarkValue(const vtkFloatingPointType theValue)
{
myMarkedValue = theValue;
}
-float
+vtkFloatingPointType
VISU_ScalarBarCtrl
::GetMarkValue() const
{
}
}
if(myGlobalRangeIsDefined){
- float aLocalRange[2];
+ vtkFloatingPointType aLocalRange[2];
myLocalLookupTable->GetTableRange(aLocalRange);
MarkValueByColor(myGlobalLookupTable, aLocalRange[0], myBlack);
MarkValueByColor(myGlobalLookupTable, aLocalRange[1], myBlack);
vtkCoordinate * aCoordinate = theScalarBarActor->GetPositionCoordinate();
aCoordinate->SetCoordinateSystemToNormalizedViewport();
if(theScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL){
- float aWidth = theScalarBarActor->GetWidth();
+ vtkFloatingPointType aWidth = theScalarBarActor->GetWidth();
aCoordinate->SetValue(myPosition[0]+theId*(aWidth+myDistance), myPosition[1]);
}else{
- float aHeight = theScalarBarActor->GetHeight();
+ vtkFloatingPointType aHeight = theScalarBarActor->GetHeight();
aCoordinate->SetValue(myPosition[0], myPosition[1]+theId*(aHeight+myDistance));
}
// Initialize Lookup Tables and Scalar Bars
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_ScalarBarCtrl.hxx
#include <vtkObject.h>
+#include "VTKViewer.h"
+
class vtkRenderer;
class vtkLookupTable;
class vtkScalarBarActor;
{
public:
vtkTypeMacro(VISU_ScalarBarCtrl, vtkObject);
- static VISU_ScalarBarCtrl* New();
+ static
+ VISU_ScalarBarCtrl*
+ New();
enum EMode {eSimple, eGlobal, eLocal};
// Mode
- void SetMode(EMode theMode);
- EMode GetMode() const;
+ void
+ SetMode(EMode theMode);
+
+ EMode
+ GetMode() const;
// Ranges
- void SetRangeGlobal(float theMin,
- float theMax);
- void SetRangeGlobal(float *theRange);
+ void
+ SetRangeGlobal(vtkFloatingPointType theMin,
+ vtkFloatingPointType theMax);
+ void
+ SetRangeGlobal(vtkFloatingPointType *theRange);
- void SetGlobalRangeIsDefined(bool theIsDefined);
+ void
+ SetGlobalRangeIsDefined(bool theIsDefined);
- void SetRangeLocal(float theMin,
- float theMax);
- void SetRangeLocal(float *theRange);
+ void
+ SetRangeLocal(vtkFloatingPointType theMin,
+ vtkFloatingPointType theMax);
+ void
+ SetRangeLocal(vtkFloatingPointType *theRange);
// Selectors
- vtkScalarBarActor* GetLocalBar();
- vtkLookupTable* GetLocalTable();
+ vtkScalarBarActor*
+ GetLocalBar();
+
+ vtkLookupTable*
+ GetLocalTable();
+
+ vtkScalarBarActor*
+ GetGlobalBar();
- vtkScalarBarActor* GetGlobalBar();
- vtkLookupTable* GetGlobalTable();
+ vtkLookupTable*
+ GetGlobalTable();
//
// Renderer
- void AddToRender(vtkRenderer* theRenderer);
- void RemoveFromRender(vtkRenderer* theRenderer);
+ void
+ AddToRender(vtkRenderer* theRenderer);
+
+ void
+ RemoveFromRender(vtkRenderer* theRenderer);
//
// Visibility
- void SetVisibility(int theFlag);
- int GetVisibility() const;
- //
+ void
+ SetVisibility(int theFlag);
+
+ int
+ GetVisibility() const;
+
// Visibility
- void SetCtrlVisibility(int theFlag);
- int GetCtrlVisibility() const;
- //
+ void
+ SetCtrlVisibility(int theFlag);
+
+ int
+ GetCtrlVisibility() const;
+
// Build
void Update();
- //
+
// Position
- void SetWidth(const float theWidth);
- float GetWidth()const;
- void SetHeight(const float theHeight);
- float GetHeight()const;
- void SetPosition(const float* thePosition);
- const float* GetPosition()const;
+ void
+ SetWidth(const vtkFloatingPointType theWidth);
+
+ vtkFloatingPointType
+ GetWidth() const;
+
+ void
+ SetHeight(const vtkFloatingPointType theHeight);
+
+ vtkFloatingPointType
+ GetHeight() const;
+
+ void
+ SetPosition(const vtkFloatingPointType* thePosition);
+
+ const vtkFloatingPointType*
+ GetPosition() const;
//
// Spacing
- void SetSpacing(const float theSpacing);
- float GetSpacing()const;
+ void
+ SetSpacing(const vtkFloatingPointType theSpacing);
+
+ vtkFloatingPointType
+ GetSpacing() const;
//
// Rainbow/bicolor
- bool GetBicolor() const;
- void SetBicolor(const bool theBicolor);
+ bool
+ GetBicolor() const;
+
+ void
+ SetBicolor(const bool theBicolor);
//
// Misc
- void SetMarkValue (const float theValue);
- float GetMarkValue ()const;
- void SetIsMarked(const bool theFlag);
- bool GetIsMarked()const;
+ void
+ SetMarkValue(const vtkFloatingPointType theValue);
+
+ vtkFloatingPointType
+ GetMarkValue() const;
+
+ void
+ SetIsMarked(const bool theFlag);
+
+ bool
+ GetIsMarked()const;
//
protected:
VISU_ScalarBarCtrl();
- virtual ~VISU_ScalarBarCtrl();
+
+ virtual
+ ~VISU_ScalarBarCtrl();
- void UpdateForBicolor();
- void UpdateForColor();
- void UpdateMarkValue();
- void PrepareTables();
+ void
+ UpdateForBicolor();
+
+ void
+ UpdateForColor();
+
+ void
+ UpdateMarkValue();
+
+ void
+ PrepareTables();
- void PrepareTables(vtkScalarBarActor* theScalarBarActor,
- vtkLookupTable *theLookupTable,
- vtkIdType theId);
+ void
+ PrepareTables(vtkScalarBarActor* theScalarBarActor,
+ vtkLookupTable *theLookupTable,
+ vtkIdType theId);
protected:
EMode myMode;
bool myGlobalRangeIsDefined;
- float myDistance;
- float myPosition[2];
+ vtkFloatingPointType myDistance;
+ vtkFloatingPointType myPosition[2];
bool myBicolor;
int myCtrlVisibility;
unsigned char myGrey[3];
//
bool myMarked;
- float myMarkedValue;
+ vtkFloatingPointType myMarkedValue;
//
vtkScalarBarActor *myGlobalScalarBar;
vtkLookupTable *myGlobalLookupTable;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_ScalarMapOnDeformedShapePL.cxx
* Merge filter which unify the deformation and scalars
* \li myScalars is vtk shared pointer to vtkUnstructuredGrid - scalars data
*/
-VISU_ScalarMapOnDeformedShapePL::VISU_ScalarMapOnDeformedShapePL(){
+VISU_ScalarMapOnDeformedShapePL
+::VISU_ScalarMapOnDeformedShapePL()
+{
myDeformVectors = vtkWarpVector::New();
myMergeFilter = vtkMergeFilter::New();
myExtractorScalars = VISU_Extractor::New();
* Destructor.
* Delete all fields.
*/
-VISU_ScalarMapOnDeformedShapePL::~VISU_ScalarMapOnDeformedShapePL(){
+VISU_ScalarMapOnDeformedShapePL
+::~VISU_ScalarMapOnDeformedShapePL()
+{
myDeformVectors->UnRegisterAllOutputs();
myDeformVectors->Delete();
/*!
* Initial method
*/
-void VISU_ScalarMapOnDeformedShapePL::Init(){
-
+void
+VISU_ScalarMapOnDeformedShapePL
+::Init()
+{
if (GetScalars() == NULL) SetScalars(GetInput2());
Superclass::Init();
- float aScalarRange[2];
+ vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
static double EPS = 1.0 / VTK_LARGE_FLOAT;
if(aScalarRange[1] > EPS)
* Build method
* Building of deformation and puts result to merge filter.
*/
-void VISU_ScalarMapOnDeformedShapePL::Build()
+void
+VISU_ScalarMapOnDeformedShapePL
+::Build()
{
// Set input for extractor
myExtractor->SetInput(GetInput2());
/*!
* Update method
*/
-void VISU_ScalarMapOnDeformedShapePL::Update(){
+void
+VISU_ScalarMapOnDeformedShapePL
+::Update()
+{
this->UpdateScalars();
- float aRange[2];
+ vtkFloatingPointType aRange[2];
GetSourceRange(aRange);
- float aScalarRange[2] = {aRange[0], aRange[1]};
+ vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]};
if(myBarTable->GetScale() == VTK_SCALE_LOG10)
VISU_LookupTable::ComputeLogRange(aRange,aScalarRange);
* Update scalars method.
* Put scalars to merge filter.
*/
-void VISU_ScalarMapOnDeformedShapePL::UpdateScalars(){
+void
+VISU_ScalarMapOnDeformedShapePL
+::UpdateScalars()
+{
if(myScalars->GetCellData()->GetVectors() != NULL ||
myScalars->GetPointData()->GetVectors() != NULL)
myMergeFilter->SetScalars(myExtractorScalars->GetOutput());
* Copy information about pipline.
* Copy scale and scalars.
*/
-void VISU_ScalarMapOnDeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){
+void
+VISU_ScalarMapOnDeformedShapePL
+::ShallowCopy(VISU_PipeLine *thePipeLine)
+{
VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine);
if(aPipeLine){
SetScale(aPipeLine->GetScale());
SetScalars(aPipeLine->GetScalars());
- float aRange[2];
+ vtkFloatingPointType aRange[2];
aPipeLine->GetSourceRange(aRange);
SetScalarRange(aRange);
}
* Set scalars.
* Sets vtkDataSet with scalars values to VISU_Extractor filter for scalars extraction.
*/
-void VISU_ScalarMapOnDeformedShapePL::SetScalars(vtkDataSet *theScalars){
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScalars(vtkDataSet *theScalars)
+{
myScalars = theScalars;
vtkUnstructuredGrid* aScalars = GetScalars();
myExtractorScalars->SetInput(aScalars);
/*!
* Get pointer to input scalars.
*/
-vtkUnstructuredGrid* VISU_ScalarMapOnDeformedShapePL::GetScalars(){
+vtkUnstructuredGrid*
+VISU_ScalarMapOnDeformedShapePL
+::GetScalars()
+{
return myScalars.GetPointer();
}
/*!
* Sets scale for deformed shape
*/
-void VISU_ScalarMapOnDeformedShapePL::SetScale(float theScale) {
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScale(vtkFloatingPointType theScale)
+{
if(myScaleFactor == theScale) return;
myScaleFactor = theScale;
myDeformVectors->SetScaleFactor(myScaleFactor);
/*!
* Gets scale of deformed shape.
*/
-float VISU_ScalarMapOnDeformedShapePL::GetScale() {
- float aScale=myDeformVectors->GetScaleFactor();
+vtkFloatingPointType
+VISU_ScalarMapOnDeformedShapePL
+::GetScale()
+{
+ vtkFloatingPointType aScale=myDeformVectors->GetScaleFactor();
return aScale;
}
/*!
* Set scale factor of deformation.
*/
-void VISU_ScalarMapOnDeformedShapePL::SetMapScale(float theMapScale){
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
myDeformVectors->SetScaleFactor(myScaleFactor*theMapScale);
Modified();
}
/*!
* Gets scalar mode.
*/
-int VISU_ScalarMapOnDeformedShapePL::GetScalarMode(){
+int
+VISU_ScalarMapOnDeformedShapePL
+::GetScalarMode()
+{
int aMode=myExtractorScalars->GetScalarMode();
return aMode;
}
/*!
* Sets scalar mode.
*/
-void VISU_ScalarMapOnDeformedShapePL::SetScalarMode(int theScalarMode){
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScalarMode(int theScalarMode)
+{
myExtractorScalars->SetScalarMode(theScalarMode);
Modified();
}
* \li theRange[0] - minimum value
* \li theRange[1] - maximum value
*/
-void VISU_ScalarMapOnDeformedShapePL::GetSourceRange(float theRange[2]){
+void
+VISU_ScalarMapOnDeformedShapePL
+::GetSourceRange(vtkFloatingPointType theRange[2])
+{
myExtractorScalars->Update();
myExtractorScalars->GetUnstructuredGridOutput()->GetScalarRange(theRange);
}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_ScalarMapOnDeformedShapePL.hxx
virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
- virtual void SetScale(float theScale);
- virtual float GetScale();
+ virtual void SetScale(vtkFloatingPointType theScale);
+ virtual vtkFloatingPointType GetScale();
virtual int GetScalarMode();
virtual void SetScalarMode(int theScalarMode = 0);
- virtual void GetSourceRange(float theRange[2]);
+ virtual void GetSourceRange(vtkFloatingPointType theRange[2]);
virtual void SetScalars(vtkDataSet *theScalars);
virtual vtkUnstructuredGrid* GetScalars();
void
UpdateScalars();
- virtual void SetMapScale(float theMapScale = 1.0);
+ virtual void SetMapScale(vtkFloatingPointType theMapScale = 1.0);
protected:
- float myScaleFactor;
+ vtkFloatingPointType myScaleFactor;
vtkWarpVector *myDeformVectors;
vtkMergeFilter *myMergeFilter;
vtkSmartPointer<vtkUnstructuredGrid> myScalars;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
//----------------------------------------------------------------------------
-float*
+vtkFloatingPointType*
VISU_ScalarMapPL
::GetScalarRange()
{
void
VISU_ScalarMapPL
-::SetScalarRange(float theRange[2])
+::SetScalarRange(vtkFloatingPointType theRange[2])
{
myFieldTransform->SetScalarRange(theRange);
myBarTable->SetRange(theRange);
void
VISU_ScalarMapPL
-::SetScalarMin(float theValue)
+::SetScalarMin(vtkFloatingPointType theValue)
{
- float aScalarRange[2] = {theValue, GetScalarRange()[1]};
+ vtkFloatingPointType aScalarRange[2] = {theValue, GetScalarRange()[1]};
SetScalarRange(aScalarRange);
}
void
VISU_ScalarMapPL
-::SetScalarMax(float theValue)
+::SetScalarMax(vtkFloatingPointType theValue)
{
- float aScalarRange[2] = {GetScalarRange()[0], theValue};
+ vtkFloatingPointType aScalarRange[2] = {GetScalarRange()[0], theValue};
SetScalarRange(aScalarRange);
}
VISU_ScalarMapPL
::Update()
{
- float *aRange = myFieldTransform->GetScalarRange();
- float aScalarRange[2] = {aRange[0], aRange[1]};
+ vtkFloatingPointType *aRange = myFieldTransform->GetScalarRange();
+ vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]};
if(myBarTable->GetScale() == VTK_SCALE_LOG10)
VISU_LookupTable::ComputeLogRange(aRange,aScalarRange);
myMapperTable->SetRange(aScalarRange);
//----------------------------------------------------------------------------
void
VISU_ScalarMapPL
-::SetMapScale(float theMapScale)
+::SetMapScale(vtkFloatingPointType theMapScale)
{
myMapperTable->SetMapScale(theMapScale);
myMapperTable->Build();
}
-float
+vtkFloatingPointType
VISU_ScalarMapPL::GetMapScale()
{
return myMapperTable->GetMapScale();
//----------------------------------------------------------------------------
void
VISU_ScalarMapPL
-::GetSourceRange(float theRange[2])
+::GetSourceRange(vtkFloatingPointType theRange[2])
{
myExtractor->Update();
myExtractor->GetOutput()->GetScalarRange(theRange);
VISU_ScalarMapPL
::SetSourceRange()
{
- float aRange[2];
+ vtkFloatingPointType aRange[2];
GetSourceRange(aRange);
SetScalarRange(aRange);
}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
SetScaling(int theScaling = VTK_SCALE_LINEAR);
virtual
- float*
+ vtkFloatingPointType*
GetScalarRange();
virtual
void
- SetScalarRange(float theRange[2]);
+ SetScalarRange(vtkFloatingPointType theRange[2]);
virtual
void
- SetScalarMin(float theValue);
+ SetScalarMin(vtkFloatingPointType theValue);
virtual
void
- SetScalarMax(float theValue);
+ SetScalarMax(vtkFloatingPointType theValue);
virtual
void
virtual
void
- SetMapScale(float theMapScale = 1.0);
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
virtual
- float
+ vtkFloatingPointType
GetMapScale();
virtual
void
- GetSourceRange(float theRange[2]);
+ GetSourceRange(vtkFloatingPointType theRange[2]);
virtual
void
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#include "VISU_SphereWidget.hxx"
#include <vtkActor.h>
mySphereActor->SetMapper(mySphereMapper);
//
// Define the point coordinates
- float bounds[6];
+ vtkFloatingPointType bounds[6];
for(int i = 0; i < 6; i += 2){
bounds[i]=-.5;
bounds[i+1]=-bounds[i];
// function: SetRadius
// purpose :
//====================================================================
-void VISU_SphereWidget::SetRadius(float theRadius)
+void VISU_SphereWidget::SetRadius(vtkFloatingPointType theRadius)
{
if ( theRadius <= myRmin ) {
theRadius = myRmin;
// function: GetRadius
// purpose :
//====================================================================
-float VISU_SphereWidget::GetRadius()
+vtkFloatingPointType VISU_SphereWidget::GetRadius()
{
return mySphereSource->GetRadius();
}
// function: SetCenter
// purpose :
//====================================================================
-void VISU_SphereWidget::SetCenter(float theCenter[3])
+void VISU_SphereWidget::SetCenter(vtkFloatingPointType theCenter[3])
{
mySphereSource->SetCenter(theCenter);
mySphere->SetCenter(theCenter);
// function: SetCenter
// purpose :
//====================================================================
-void VISU_SphereWidget::SetCenter(float theX, float theY, float theZ)
+void VISU_SphereWidget::SetCenter(vtkFloatingPointType theX, vtkFloatingPointType theY, vtkFloatingPointType theZ)
{
- float aCenter[3] = {theX, theY, theZ};
+ vtkFloatingPointType aCenter[3] = {theX, theY, theZ};
SetCenter(aCenter);
}
// function: GetCenter
// purpose :
//====================================================================
-float* VISU_SphereWidget::GetCenter()
+vtkFloatingPointType* VISU_SphereWidget::GetCenter()
{
return mySphereSource->GetCenter();
}
// function: GetCenter
// purpose :
//====================================================================
-void VISU_SphereWidget::GetCenter(float theCenter[3])
+void VISU_SphereWidget::GetCenter(vtkFloatingPointType theCenter[3])
{
mySphereSource->GetCenter(theCenter);
}
//====================================================================
void VISU_SphereWidget::Translate(double *p1, double *p2)
{
- float v[3], aC[3], aC1[3];
+ vtkFloatingPointType v[3], aC[3], aC1[3];
//
v[0] = p2[0] - p1[0];
v[1] = p2[1] - p1[1];
v[1] = p2[1] - p1[1];
v[2] = p2[2] - p1[2];
//
- float aC[3], aR, sf, aR1;
+ vtkFloatingPointType aC[3], aR, sf, aR1;
aR=mySphereSource->GetRadius();
mySphereSource->GetCenter(aC);
sf=vtkMath::Norm(v)/aR;
// function:PlaceWidget
// purpose:
//====================================================================
-void VISU_SphereWidget::PlaceWidget(float bds[6])
+void VISU_SphereWidget::PlaceWidget(vtkFloatingPointType bds[6])
{
- float bounds[6], center[3], radius;
+ vtkFloatingPointType bounds[6], center[3], radius;
this->AdjustBounds(bds, bounds, center);
- float dX, dY, dZ;
+ vtkFloatingPointType dX, dY, dZ;
//
dX=bounds[1]-bounds[0];
dY=bounds[3]-bounds[2];
(bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
- static float EPS = 1.0E-1;
+ static vtkFloatingPointType EPS = 1.0E-1;
myRmin = EPS*InitialLength;
}
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#ifndef __VISU_SphereWidget_h
#define __VISU_SphereWidget_h
virtual void SetEnabled(int);
//
//PlaceWidget
- virtual void PlaceWidget(float bounds[6]);
+ virtual void PlaceWidget(vtkFloatingPointType bounds[6]);
//
// Description:
// Set/Get the resolution of the sphere in the Theta direction.
// Description:
// Set/Get the radius of sphere. Default is .5.
- void SetRadius(float r);
- float GetRadius();
+ void SetRadius(vtkFloatingPointType r);
+ vtkFloatingPointType GetRadius();
// Description:
// Set/Get the center of the sphere.
- void SetCenter(float x, float y, float z);
- void SetCenter(float x[3]);
+ void SetCenter(vtkFloatingPointType x,
+ vtkFloatingPointType y,
+ vtkFloatingPointType z);
+ void SetCenter(vtkFloatingPointType x[3]);
- float* GetCenter();
- void GetCenter(float xyz[3]);
+ vtkFloatingPointType* GetCenter();
+ void GetCenter(vtkFloatingPointType xyz[3]);
// Description:
// Set the ratio of the radius changing.
- void SetRatio(float r) { myRatio = r; }
- float GetRatio() { return myRatio; }
+ void SetRatio(vtkFloatingPointType r) { myRatio = r; }
+ vtkFloatingPointType GetRatio() { return myRatio; }
void ChangeRadius(bool up);
// the manipulator in general.
vtkProperty *mySphereProperty;
vtkProperty *mySelectedSphereProperty;
- float myRmin;
+ vtkFloatingPointType myRmin;
vtkSphere *mySphere;
vtkImplicitSum* myImplicitSum;
- float myRatio;
+ vtkFloatingPointType myRatio;
private:
VISU_SphereWidget(const VISU_SphereWidget&); //Not implemented
void operator=(const VISU_SphereWidget&); //Not implemented
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_PipeLine.cxx
static int MYDEBUG = 0;
#endif
-static float EPS = 1.0e-7;
-static float aMinNbOfSteps = 1.0E+2;
-//static float aMaxNbOfSteps = 1.0E+3;
-static float aCoeffOfIntStep = 1.0E+1;
+static vtkFloatingPointType EPS = 1.0e-7;
+static vtkFloatingPointType aMinNbOfSteps = 1.0E+2;
+//static vtkFloatingPointType aMaxNbOfSteps = 1.0E+3;
+static vtkFloatingPointType aCoeffOfIntStep = 1.0E+1;
vtkStandardNewMacro(VISU_StreamLinesPL);
}
-float VISU_StreamLinesPL::GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength,
- float thePropogationTime, float thePercents)
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetNecasseryMemorySize(vtkIdType theNbOfPoints,
+ vtkFloatingPointType theStepLength,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType thePercents)
{
- static float aStreamPointSize = sizeof(float)*15 + sizeof(vtkIdType)*2;
- static float aStreamArraySize = aStreamPointSize*1024; // == 69632
+ static vtkFloatingPointType aStreamPointSize = sizeof(vtkFloatingPointType)*15 + sizeof(vtkIdType)*2;
+ static vtkFloatingPointType aStreamArraySize = aStreamPointSize*1024; // == 69632
- float aNbCells = thePercents*theNbOfPoints*2.0;
- float aNbPointsPerCell = thePropogationTime/theStepLength;
- float aCellsSize = aNbCells*(1+aNbPointsPerCell);
- float aPointsSize = aCellsSize*3.0*sizeof(float);
+ vtkFloatingPointType aNbCells = thePercents*theNbOfPoints*2.0;
+ vtkFloatingPointType aNbPointsPerCell = thePropogationTime/theStepLength;
+ vtkFloatingPointType aCellsSize = aNbCells*(1+aNbPointsPerCell);
+ vtkFloatingPointType aPointsSize = aCellsSize*3.0*sizeof(vtkFloatingPointType);
- float aConnectivitySize = aCellsSize*sizeof(vtkIdType);
- float aTypesSize = aNbCells*sizeof(char);
- float aLocationsSize = aNbCells*sizeof(int);
- //float aNbCellsPerPoint = aCellsSize / aNbCells - 1;
- float aMeshSize = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize;
+ vtkFloatingPointType aConnectivitySize = aCellsSize*sizeof(vtkIdType);
+ vtkFloatingPointType aTypesSize = aNbCells*sizeof(char);
+ vtkFloatingPointType aLocationsSize = aNbCells*sizeof(int);
+ //vtkFloatingPointType aNbCellsPerPoint = aCellsSize / aNbCells - 1;
+ vtkFloatingPointType aMeshSize = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize;
- float anAssignedDataSize = aCellsSize*4.0*sizeof(float);
- float anOutputDataSetSize = aMeshSize + anAssignedDataSize;
+ vtkFloatingPointType anAssignedDataSize = aCellsSize*4.0*sizeof(vtkFloatingPointType);
+ vtkFloatingPointType anOutputDataSetSize = aMeshSize + anAssignedDataSize;
- float aResult = aStreamArraySize*aNbCells + anOutputDataSetSize;
+ vtkFloatingPointType aResult = aStreamArraySize*aNbCells + anOutputDataSetSize;
return aResult;
}
-int VISU_StreamLinesPL::FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength,
- float& thePropogationTime, float& thePercents)
+int
+VISU_StreamLinesPL
+::FindPossibleParams(vtkPointSet* theDataSet,
+ vtkFloatingPointType& theStepLength,
+ vtkFloatingPointType& thePropogationTime,
+ vtkFloatingPointType& thePercents)
{
- static float aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0;
+ static vtkFloatingPointType aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0;
vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
- float aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
+ vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
int isPoss = CheckAvailableMemory(aSize);
if(!isPoss){
- float aMaxStepLength = max(GetMaxStepLength(theDataSet),thePropogationTime);
- float aMinStepLength = GetMinStepLength(theDataSet);
- float aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease;
+ vtkFloatingPointType aMaxStepLength = max(GetMaxStepLength(theDataSet),thePropogationTime);
+ vtkFloatingPointType aMinStepLength = GetMinStepLength(theDataSet);
+ vtkFloatingPointType aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease;
for(int i = 2, aStepChanged = 1, aPerecentsChanged = 1; aStepChanged || aPerecentsChanged; i++){
- float aStepLength = theStepLength + aDeltaStepLength;
+ vtkFloatingPointType aStepLength = theStepLength + aDeltaStepLength;
if(aStepLength < aMaxStepLength) theStepLength = aStepLength;
else if(aStepChanged){
aStepLength = aMaxStepLength;
aStepChanged = 0;
}
- float aPercents = thePercents /= aPercentsDecrease;
+ vtkFloatingPointType aPercents = thePercents /= aPercentsDecrease;
if(aPercents*aNbOfPoints > 1) thePercents = aPercents;
else if(aPerecentsChanged) {
thePercents = 1.1 / aNbOfPoints;
}
-int VISU_StreamLinesPL::SetParams(float theIntStep,
- float thePropogationTime,
- float theStepLength,
- vtkPointSet* theSource,
- float thePercents,
- int theDirection,
- int isOnlyTry)
+int
+VISU_StreamLinesPL
+::SetParams(vtkFloatingPointType theIntStep,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType theStepLength,
+ vtkPointSet* theSource,
+ vtkFloatingPointType thePercents,
+ int theDirection,
+ int isOnlyTry)
{
vtkPointSet* aDataSet = theSource? theSource: myFieldTransform->GetUnstructuredGridOutput();
aDataSet->Update();
}
-vtkPointSet* VISU_StreamLinesPL::GetSource() {
+vtkPointSet*
+VISU_StreamLinesPL
+::GetSource()
+{
return mySource;
}
-float VISU_StreamLinesPL::GetUsedPoints() {
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetUsedPoints()
+{
return myPercents;
}
-vtkDataSet* VISU_StreamLinesPL::GetStreamerSource(){
+vtkDataSet*
+VISU_StreamLinesPL
+::GetStreamerSource()
+{
return myStream->GetSource();
}
-float VISU_StreamLinesPL::GetVelocityCoeff(){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetVelocityCoeff()
+{
return GetVelocityCoeff(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::GetVelocityCoeff(vtkPointSet* theDataSet){
- float* aScalarRange = theDataSet->GetScalarRange();
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetVelocityCoeff(vtkPointSet* theDataSet)
+{
+ vtkFloatingPointType* aScalarRange = theDataSet->GetScalarRange();
return (fabs(aScalarRange[1]) + fabs(aScalarRange[0]))/2.0;
}
-int VISU_StreamLinesPL::IsPossible(vtkPointSet* theDataSet, float thePercents){
- float aStepLength = GetBaseStepLength(theDataSet);
- float aBasePropTime = GetBasePropagationTime(theDataSet);
+int
+VISU_StreamLinesPL
+::IsPossible(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents)
+{
+ vtkFloatingPointType aStepLength = GetBaseStepLength(theDataSet);
+ vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet);
VISU_UsedPointsFilter *aPointsFilter = VISU_UsedPointsFilter::New();
aPointsFilter->SetInput(theDataSet);
vtkPointSet* aDataSet = aPointsFilter->GetOutput();
}
-float VISU_StreamLinesPL::GetIntegrationStep(){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetIntegrationStep()
+{
return myStream->GetIntegrationStepLength();
}
-float VISU_StreamLinesPL::GetStepLength() {
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetStepLength()
+{
return myStream->GetStepLength();
}
-float VISU_StreamLinesPL::GetPropagationTime() {
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetPropagationTime()
+{
return myStream->GetMaximumPropagationTime();
}
-int VISU_StreamLinesPL::GetDirection(){
+
+int
+VISU_StreamLinesPL
+::GetDirection()
+{
return myStream->GetIntegrationDirection();
}
-float VISU_StreamLinesPL::GetMinIntegrationStep(vtkPointSet* theDataSet, float thePercents) {
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinIntegrationStep(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents)
+{
if(!theDataSet) return -1.0;
- float aVolume = 1.0;
+ vtkFloatingPointType aVolume = 1.0;
int degree = 0;
theDataSet->Update();
- float* aBounds = theDataSet->GetBounds();
+ vtkFloatingPointType* aBounds = theDataSet->GetBounds();
for(int i = 0, j = 0; i < 3; ++i, j = 2*i){
- float tmp = aBounds[j+1] - aBounds[j];
+ vtkFloatingPointType tmp = aBounds[j+1] - aBounds[j];
if (tmp > EPS ) {
aVolume *= tmp;
degree += 1;
}
}
if (degree < 1) return 0.0; // absolutely empty object
- float anStepLength = GetMaxIntegrationStep(theDataSet)/aCoeffOfIntStep;
- float aBasePropTime = GetBasePropagationTime(theDataSet)/GetVelocityCoeff(theDataSet);
+ vtkFloatingPointType anStepLength = GetMaxIntegrationStep(theDataSet)/aCoeffOfIntStep;
+ vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet)/GetVelocityCoeff(theDataSet);
thePercents = 1.0;
vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
- float aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents);
- float aRealSize = GetAvailableMemory(aSize);
- float anAverageVolume = aVolume / aRealSize;
- float aStep = pow(double(anAverageVolume), double(1.0/double(degree)));
+ vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents);
+ vtkFloatingPointType aRealSize = GetAvailableMemory(aSize);
+ vtkFloatingPointType anAverageVolume = aVolume / aRealSize;
+ vtkFloatingPointType aStep = pow(double(anAverageVolume), double(1.0/double(degree)));
return aStep;
}
-float VISU_StreamLinesPL::GetMinIntegrationStep(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinIntegrationStep()
+{
return GetMinIntegrationStep(myExtractor->GetOutput(),GetUsedPoints());
}
-float VISU_StreamLinesPL::GetMaxIntegrationStep(vtkPointSet* theDataSet) {
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxIntegrationStep(vtkPointSet* theDataSet)
+{
if(!theDataSet) return -1.0;
theDataSet->Update();
- float aLength = theDataSet->GetLength();
- float* aBounds = theDataSet->GetBounds();
- float aMaxSizeY = (aBounds[3]-aBounds[2])/aLength;
- float aMaxSizeZ = (aBounds[5]-aBounds[4])/aLength;
- float aMinMax = (aBounds[1] - aBounds[0])/aLength;
+ vtkFloatingPointType aLength = theDataSet->GetLength();
+ vtkFloatingPointType* aBounds = theDataSet->GetBounds();
+ vtkFloatingPointType aMaxSizeY = (aBounds[3]-aBounds[2])/aLength;
+ vtkFloatingPointType aMaxSizeZ = (aBounds[5]-aBounds[4])/aLength;
+ vtkFloatingPointType aMinMax = (aBounds[1] - aBounds[0])/aLength;
if (aMinMax < EPS || (aMaxSizeY < aMinMax && aMaxSizeY > EPS)) aMinMax = aMaxSizeY;
if (aMinMax < EPS || (aMaxSizeZ < aMinMax && aMaxSizeZ > EPS)) aMinMax = aMaxSizeZ;
return aMinMax*aLength/2.0;
}
-float VISU_StreamLinesPL::GetMaxIntegrationStep(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxIntegrationStep()
+{
return GetMaxIntegrationStep(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::GetBaseIntegrationStep(vtkPointSet* theDataSet, float thePercents){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetBaseIntegrationStep(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents)
+{
theDataSet->Update();
- float aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
- float aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
- float anIntegrationStep = aMaxIntegrationStep / aCoeffOfIntStep;
- float aMinMax = theDataSet->GetLength()/theDataSet->GetNumberOfPoints();
+ vtkFloatingPointType aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
+ vtkFloatingPointType aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
+ vtkFloatingPointType anIntegrationStep = aMaxIntegrationStep / aCoeffOfIntStep;
+ vtkFloatingPointType aMinMax = theDataSet->GetLength()/theDataSet->GetNumberOfPoints();
if(aMinMax > anIntegrationStep)
anIntegrationStep = (anIntegrationStep*aCoeffOfIntStep*0.9+aMinMax)/aCoeffOfIntStep;
if(aMinIntegrationStep > anIntegrationStep)
return anIntegrationStep;
}
-float VISU_StreamLinesPL::CorrectIntegrationStep(float theStep, vtkPointSet* theDataSet, float thePercents){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::CorrectIntegrationStep(vtkFloatingPointType theStep,
+ vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents)
+{
theDataSet->Update();
- float aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
- float aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
+ vtkFloatingPointType aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
+ vtkFloatingPointType aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
if(aMinIntegrationStep > theStep)
theStep = aMinIntegrationStep;
if(aMaxIntegrationStep < theStep)
}
-float VISU_StreamLinesPL::GetMinPropagationTime(vtkPointSet* theDataSet){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinPropagationTime(vtkPointSet* theDataSet)
+{
if(!theDataSet) return -1.0;
return GetMinStepLength(theDataSet);
}
-float VISU_StreamLinesPL::GetMinPropagationTime(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinPropagationTime()
+{
return GetMinPropagationTime(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::GetMaxPropagationTime(vtkPointSet* theDataSet){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxPropagationTime(vtkPointSet* theDataSet)
+{
if(!theDataSet) return -1.0;
return GetBasePropagationTime(theDataSet)*aMinNbOfSteps;
}
-float VISU_StreamLinesPL::GetMaxPropagationTime(){
+
+vtkFloatingPointType VISU_StreamLinesPL::GetMaxPropagationTime(){
return GetMaxPropagationTime(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::CorrectPropagationTime(float thePropagationTime, vtkPointSet* theDataSet){
- float aMinPropagationTime = GetMinPropagationTime(theDataSet);
- float aMaxPropagationTime = GetMaxPropagationTime(theDataSet);
+vtkFloatingPointType
+VISU_StreamLinesPL
+::CorrectPropagationTime(vtkFloatingPointType thePropagationTime,
+ vtkPointSet* theDataSet)
+{
+ vtkFloatingPointType aMinPropagationTime = GetMinPropagationTime(theDataSet);
+ vtkFloatingPointType aMaxPropagationTime = GetMaxPropagationTime(theDataSet);
if(aMinPropagationTime > thePropagationTime)
thePropagationTime = aMinPropagationTime;
if(aMaxPropagationTime < thePropagationTime)
thePropagationTime = aMaxPropagationTime;
return thePropagationTime;
}
-float VISU_StreamLinesPL::GetBasePropagationTime(vtkPointSet* theDataSet){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetBasePropagationTime(vtkPointSet* theDataSet)
+{
if(!theDataSet) return -1.0;
theDataSet->Update();
- float aPropagationTime = theDataSet->GetLength()/GetVelocityCoeff(theDataSet);
+ vtkFloatingPointType aPropagationTime = theDataSet->GetLength()/GetVelocityCoeff(theDataSet);
return aPropagationTime;
}
-float VISU_StreamLinesPL::GetBasePropagationTime(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetBasePropagationTime()
+{
return GetBasePropagationTime(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::GetMinStepLength(vtkPointSet* theDataSet){
- static float aNbOfStepsOfIntStep = 1.0E+1;
- float anIntStep = GetMinIntegrationStep(theDataSet);
- float aStepLength = anIntStep*aNbOfStepsOfIntStep/GetVelocityCoeff(theDataSet);
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinStepLength(vtkPointSet* theDataSet)
+{
+ static vtkFloatingPointType aNbOfStepsOfIntStep = 1.0E+1;
+ vtkFloatingPointType anIntStep = GetMinIntegrationStep(theDataSet);
+ vtkFloatingPointType aStepLength = anIntStep*aNbOfStepsOfIntStep/GetVelocityCoeff(theDataSet);
return aStepLength;
}
-float VISU_StreamLinesPL::GetMinStepLength(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinStepLength()
+{
return GetMinStepLength(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::GetMaxStepLength(vtkPointSet* theDataSet){
- float aStepLength = GetBasePropagationTime(theDataSet);
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxStepLength(vtkPointSet* theDataSet)
+{
+ vtkFloatingPointType aStepLength = GetBasePropagationTime(theDataSet);
return aStepLength;
}
-float VISU_StreamLinesPL::GetMaxStepLength(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxStepLength()
+{
return GetMaxStepLength(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::CorrectStepLength(float theStep, vtkPointSet* theDataSet){
- float aMinStep = GetMinStepLength(theDataSet);
+vtkFloatingPointType
+VISU_StreamLinesPL
+::CorrectStepLength(vtkFloatingPointType theStep,
+ vtkPointSet* theDataSet)
+{
+ vtkFloatingPointType aMinStep = GetMinStepLength(theDataSet);
if(theStep < aMinStep) theStep = aMinStep;
- float aMaxStep = GetMaxStepLength(theDataSet);
+ vtkFloatingPointType aMaxStep = GetMaxStepLength(theDataSet);
if(theStep > aMaxStep) theStep = aMaxStep;
return theStep;
}
-float VISU_StreamLinesPL::GetBaseStepLength(vtkPointSet* theDataSet){
- static float anAvgNbOfSteps = 1.0E+2;
- float aPropagationTime = GetBasePropagationTime(theDataSet);
- float aStepLength = aPropagationTime/anAvgNbOfSteps;
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetBaseStepLength(vtkPointSet* theDataSet)
+{
+ static vtkFloatingPointType anAvgNbOfSteps = 1.0E+2;
+ vtkFloatingPointType aPropagationTime = GetBasePropagationTime(theDataSet);
+ vtkFloatingPointType aStepLength = aPropagationTime/anAvgNbOfSteps;
aStepLength = CorrectStepLength(aStepLength,theDataSet);
return aStepLength;
}
-void VISU_StreamLinesPL::Init(){
+void
+VISU_StreamLinesPL
+::Init()
+{
VISU_ScalarMapPL::Init();
vtkPointSet* aDataSet = myExtractor->GetOutput();
- float anIntStep = GetBaseIntegrationStep(aDataSet);
- float aPropagationTime = GetBasePropagationTime(aDataSet);
- float aStepLength = GetBaseStepLength(aDataSet);
+ vtkFloatingPointType anIntStep = GetBaseIntegrationStep(aDataSet);
+ vtkFloatingPointType aPropagationTime = GetBasePropagationTime(aDataSet);
+ vtkFloatingPointType aStepLength = GetBaseStepLength(aDataSet);
SetParams(anIntStep,aPropagationTime,aStepLength);
}
-VISU_ScalarMapPL::THook* VISU_StreamLinesPL::DoHook(){
+VISU_ScalarMapPL::THook*
+VISU_StreamLinesPL
+::DoHook()
+{
GetInput2()->Update();
VISU::CellDataToPoint(myStream,myCellDataToPointData,GetInput2(),myFieldTransform);
- float *aBounds = GetInput2()->GetBounds();
+ vtkFloatingPointType *aBounds = GetInput2()->GetBounds();
myGeomFilter->SetExtent(aBounds);
myGeomFilter->ExtentClippingOn();
myGeomFilter->SetInput(myStream->GetOutput());
return myGeomFilter->GetOutput();
}
-void VISU_StreamLinesPL::Update(){
+void
+VISU_StreamLinesPL
+::Update()
+{
VISU_ScalarMapPL::Update();
}
-void VISU_StreamLinesPL::SetMapScale(float theMapScale){
+void
+VISU_StreamLinesPL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
VISU_ScalarMapPL::SetMapScale(theMapScale);
}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_PipeLine.hxx
protected:
VISU_StreamLinesPL();
VISU_StreamLinesPL(const VISU_StreamLinesPL&);
+
+ virtual
+ ~VISU_StreamLinesPL();
+
public:
vtkTypeMacro(VISU_StreamLinesPL,VISU_DeformedShapePL);
- static VISU_StreamLinesPL* New();
- virtual ~VISU_StreamLinesPL();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
-
- virtual int SetParams(float theIntStep,
- float thePropogationTime,
- float theStepLength,
- vtkPointSet* theSource = NULL,
- float thePercents = 0.3,
- int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS,
- int isOnlyTry = false);
- virtual vtkPointSet* GetSource();
- virtual float GetUsedPoints();
- virtual float GetIntegrationStep();
- virtual float GetPropagationTime();
- virtual float GetStepLength();
- virtual int GetDirection();
-
- virtual vtkDataSet* GetStreamerSource();
- virtual float GetVelocityCoeff();
-
- virtual float GetMaxIntegrationStep();
- virtual float GetMinIntegrationStep();
-
- virtual float GetMinStepLength();
- virtual float GetMaxStepLength();
-
- virtual float GetMinPropagationTime();
- virtual float GetMaxPropagationTime();
- virtual float GetBasePropagationTime();
+
+ static
+ VISU_StreamLinesPL*
+ New();
+
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
+
+ virtual
+ int
+ SetParams(vtkFloatingPointType theIntStep,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType theStepLength,
+ vtkPointSet* theSource = NULL,
+ vtkFloatingPointType thePercents = 0.3,
+ int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS,
+ int isOnlyTry = false);
+
+ virtual
+ vtkPointSet*
+ GetSource();
+
+ virtual
+ vtkFloatingPointType
+ GetUsedPoints();
+
+ virtual
+ vtkFloatingPointType
+ GetIntegrationStep();
+
+ virtual
+ vtkFloatingPointType
+ GetPropagationTime();
+
+ virtual
+ vtkFloatingPointType
+ GetStepLength();
+
+ virtual
+ int
+ GetDirection();
+
+ virtual
+ vtkDataSet*
+ GetStreamerSource();
+
+ virtual
+ vtkFloatingPointType
+ GetVelocityCoeff();
+
+ virtual
+ vtkFloatingPointType
+ GetMaxIntegrationStep();
+
+ virtual
+ vtkFloatingPointType
+ GetMinIntegrationStep();
+
+ virtual
+ vtkFloatingPointType
+ GetMinStepLength();
+
+ virtual
+ vtkFloatingPointType
+ GetMaxStepLength();
+
+ virtual
+ vtkFloatingPointType
+ GetMinPropagationTime();
+
+ virtual
+ vtkFloatingPointType
+ GetMaxPropagationTime();
+
+ virtual
+ vtkFloatingPointType
+ GetBasePropagationTime();
public:
- virtual THook* DoHook();
- virtual void Init();
- virtual void Update();
- virtual void SetMapScale(float theMapScale = 1.0);
+ virtual
+ THook*
+ DoHook();
+
+ virtual
+ void
+ Init();
+
+ virtual
+ void
+ Update();
+
+ virtual
+ void
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
public:
- static float GetMaxIntegrationStep(vtkPointSet* theDataSet);
- static float GetMinIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3);
- static float GetBaseIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3);
+ static
+ vtkFloatingPointType
+ GetMaxIntegrationStep(vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ GetMinIntegrationStep(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents = 0.3);
+ static
+ vtkFloatingPointType
+ GetBaseIntegrationStep(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents = 0.3);
- static float GetMinPropagationTime(vtkPointSet* theDataSet);
- static float GetMaxPropagationTime(vtkPointSet* theDataSet);
- static float GetBasePropagationTime(vtkPointSet* theDataSet);
+ static
+ vtkFloatingPointType
+ GetMinPropagationTime(vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ GetMaxPropagationTime(vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ GetBasePropagationTime(vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ GetMinStepLength(vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ GetMaxStepLength(vtkPointSet* theDataSet);
- static float GetMinStepLength(vtkPointSet* theDataSet);
- static float GetMaxStepLength(vtkPointSet* theDataSet);
- static float GetBaseStepLength(vtkPointSet* theDataSet);
+ static
+ vtkFloatingPointType
+ GetBaseStepLength(vtkPointSet* theDataSet);
- static float GetVelocityCoeff(vtkPointSet* theDataSet);
+ static
+ vtkFloatingPointType
+ GetVelocityCoeff(vtkPointSet* theDataSet);
- static int IsPossible(vtkPointSet* theDataSet, float thePercents = 0.3);
+ static
+ int
+ IsPossible(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents = 0.3);
protected:
- static float GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength,
- float thePropogationTime, float thePercents = 0.3);
- static int FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength,
- float& thePropogationTime, float& thePercents);
+ static
+ vtkFloatingPointType
+ GetNecasseryMemorySize(vtkIdType theNbOfPoints,
+ vtkFloatingPointType theStepLength,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType thePercents = 0.3);
+
+ static
+ int
+ FindPossibleParams(vtkPointSet* theDataSet,
+ vtkFloatingPointType& theStepLength,
+ vtkFloatingPointType& thePropogationTime,
+ vtkFloatingPointType& thePercents);
- static float CorrectIntegrationStep(float theStep, vtkPointSet* theDataSet, float thePercents = 0.3);
- static float CorrectPropagationTime(float thePropagationTime, vtkPointSet* theDataSet);
- static float CorrectStepLength(float theStep, vtkPointSet* theDataSet);
+ static
+ vtkFloatingPointType
+ CorrectIntegrationStep(vtkFloatingPointType theStep,
+ vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents = 0.3);
+
+ static
+ vtkFloatingPointType
+ CorrectPropagationTime(vtkFloatingPointType thePropagationTime,
+ vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ CorrectStepLength(vtkFloatingPointType theStep,
+ vtkPointSet* theDataSet);
vtkStreamLine* myStream;
vtkPointSet* mySource;
vtkCellCenters* myCenters;
VTKViewer_GeometryFilter *myGeomFilter;
VISU_UsedPointsFilter *myPointsFilter;
- float myPercents;
+ vtkFloatingPointType myPercents;
};
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_StreamLinesPL.cxx
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_UsedPointsFilter.hxx
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_PipeLine.cxx
void
VISU_VectorsPL
-::SetScale(float theScale)
+::SetScale(vtkFloatingPointType theScale)
{
if(myScaleFactor == theScale)
return;
Modified();
}
-float
+vtkFloatingPointType
VISU_VectorsPL
::GetScale()
{
void
VISU_VectorsPL
-::SetMapScale(float theMapScale)
+::SetMapScale(vtkFloatingPointType theMapScale)
{
VISU_ScalarMapPL::SetMapScale(theMapScale);
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_PipeLine.hxx
protected:
VISU_VectorsPL();
VISU_VectorsPL(const VISU_VectorsPL&);
+
+ virtual
+ ~VISU_VectorsPL();
+
public:
vtkTypeMacro(VISU_VectorsPL,VISU_DeformedShapePL);
- static VISU_VectorsPL* New();
- virtual ~VISU_VectorsPL();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
- virtual void SetScale(float theScale);
- virtual float GetScale();
+ static
+ VISU_VectorsPL*
+ New();
+
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
+
+ virtual
+ void
+ SetScale(vtkFloatingPointType theScale);
+
+ virtual
+ vtkFloatingPointType
+ GetScale();
enum GlyphType{ ARROW, CONE2, CONE6, NONE};
- virtual void SetGlyphType(GlyphType theType) { myTypeGlyph = theType;}
- virtual GlyphType GetGlyphType() { return myTypeGlyph;}
+
+ virtual
+ void
+ SetGlyphType(GlyphType theType)
+ {
+ myTypeGlyph = theType;
+ }
+
+ virtual
+ GlyphType
+ GetGlyphType()
+ {
+ return myTypeGlyph;
+ }
enum GlyphPos{ CENTER, TAIL,HEAD};
- virtual void SetGlyphPos(GlyphPos thePos) { myPosGlyph = thePos;}
- virtual GlyphPos GetGlyphPos() { return myPosGlyph;}
+
+ virtual
+ void
+ SetGlyphPos(GlyphPos thePos)
+ {
+ myPosGlyph = thePos;
+ }
+
+ virtual
+ GlyphPos
+ GetGlyphPos()
+ {
+ return myPosGlyph;
+ }
public:
- virtual void Init();
- virtual void Update();
+ virtual
+ void
+ Init();
+
+ virtual
+ void
+ Update();
vtkDataSet*
GetOutput();
- virtual void SetTransform(VTKViewer_Transform* theTransform);
- virtual VTKViewer_Transform* GetTransform();
+ virtual
+ void
+ SetTransform(VTKViewer_Transform* theTransform);
+
+ virtual
+ VTKViewer_Transform*
+ GetTransform();
- virtual void SetMapScale(float theMapScale = 1.0);
+ virtual
+ void
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
protected:
- virtual THook* DoHook();
+ virtual
+ THook*
+ DoHook();
GlyphType myTypeGlyph;
GlyphPos myPosGlyph;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// function: PlaceWidget
// purpose :
//==================================================================
-void VISU_WidgetCtrl::PlaceWidget(float theBounds[6])
+void VISU_WidgetCtrl::PlaceWidget(vtkFloatingPointType theBounds[6])
{
for (int i=0; i<myNbWidgets; ++i) {
myWidgets[i]->PlaceWidget(theBounds);
// function: SetPlaceFactor
// purpose :
//==================================================================
-void VISU_WidgetCtrl::SetPlaceFactor(float theFactor)
+void VISU_WidgetCtrl::SetPlaceFactor(vtkFloatingPointType theFactor)
{
for (int i=0; i<myNbWidgets; ++i) {
myWidgets[i]->SetPlaceFactor(theFactor);
// function: GetPlaceFactor
// purpose :
//==================================================================
-float VISU_WidgetCtrl::GetPlaceFactor()
+vtkFloatingPointType VISU_WidgetCtrl::GetPlaceFactor()
{
return myWidgets[0]->GetPlaceFactor();
}
}
//==================================================================
-float
+vtkFloatingPointType
VISU_WidgetCtrl
-::EvaluateFunction(float theX[3])
+::EvaluateFunction(vtkFloatingPointType theX[3])
{
if(VISU_ImplicitFunctionWidget* aWidget = GetActiveWidget()){
if(vtkImplicitFunction* aFunction = aWidget->ImplicitFunction())
//==================================================================
void
VISU_WidgetCtrl
-::EvaluateGradient(float theX[3], float theG[3])
+::EvaluateGradient(vtkFloatingPointType theX[3],
+ vtkFloatingPointType theG[3])
{
theG[0] = theG[1] = theG[2] = 0.0;
if(VISU_ImplicitFunctionWidget* aWidget = GetActiveWidget()){
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#define __VISU_WidgetCtrl_hxx
#include "VISUPipeline.hxx"
-
#include <vtkImplicitFunction.h>
+#include "VTKViewer.h"
+
class vtkImplicitFunction;
class vtkObject;
class vtkRenderWindowInteractor;
vtkImplicitFunction* ImplicitFunction();
virtual
- float
- EvaluateFunction(float theX[3]);
+ vtkFloatingPointType
+ EvaluateFunction(vtkFloatingPointType theX[3]);
virtual
void
- EvaluateGradient(float theX[3], float theG[3]);
+ EvaluateGradient(vtkFloatingPointType theX[3],
+ vtkFloatingPointType theG[3]);
virtual
unsigned long
GetMTime();
- void PlaceWidget(float theBounds[6]);
+ void PlaceWidget(vtkFloatingPointType theBounds[6]);
void SetEnabled(int theFlag);
int GetEnabled();
void On() {SetEnabled(1);}
void SetInteractor(vtkRenderWindowInteractor* theRWI);
vtkRenderWindowInteractor* GetInteractor();
//
- void SetPlaceFactor(float theFactor);
- float GetPlaceFactor();
+ void
+ SetPlaceFactor(vtkFloatingPointType theFactor);
+
+ vtkFloatingPointType
+ GetPlaceFactor();
//
void SetActiveIndex(const int theFlag);
int GetActiveIndex()const;
int myActiveIndex;
int myCounter;
int myDisableAll;
- float myPriority;
+ vtkFloatingPointType myPriority;
VISU_ImplicitFunctionWidget *myWidgets[2];
VISU_ImplicitFunctionWidget *myDummyWidget;
VISU_PlanesWidget *myPlanesWidget;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_img2vti.cxx
# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
#
#
# .po files to transform in .qm
PO_FILES = \
- VISU_msg_en.po VISU_images.po VISUM_msg_en.po VISUM_images.po
+ VISU_msg_en.po VISU_images.po
# Libraries targets
LIB = libVISU.la
CPPFLAGS += -ftemplate-depth-32 $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) \
$(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(QWT_INCLUDES) \
- -I${KERNEL_ROOT_DIR}/include/salome \
- -I${MED_ROOT_DIR}/include/salome \
+ $(KERNEL_CXXFLAGS) \
+ $(MED_CXXFLAGS) \
$(BOOST_CPPFLAGS)
CXXFLAGS += -ftemplate-depth-32 $(OCC_CXXFLAGS) \
- -I${KERNEL_ROOT_DIR}/include/salome \
- -I${GUI_ROOT_DIR}/include/salome
+ $(KERNEL_CXXFLAGS) \
+ $(GUI_CXXFLAGS)
LDFLAGS += $(QWT_LIBS) -lSalomeNS \
-lSVTK -lVVTK -lSPlot2d -lVisuObject -lVISUEngineImpl -lVISUGUITOOLS \
- -L${KERNEL_ROOT_DIR}/lib/salome \
- -L${GUI_ROOT_DIR}/lib/salome
+ $(KERNEL_LDFLAGS) \
+ $(GUI_LDFLAGS)
@CONCLUDE@
# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
#
#
"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
+msgid "ICON_IMPORT_MED"
+msgstr "Visu_import_med.png"
msgid "ICON_OBJBROWSER_Visu"
msgstr "Visu_tree_visu.png"
msgid "ICON_SCALING"
msgstr "Visu_scaling.png"
-#
-
msgid "ICON_TIMEANIMATION"
msgstr "Visu_anim.png"
msgid "ICON_CUBE_AXES"
msgstr "Visu_graduated_axes.png"
+
+msgid "ICON_GAUSS_NEW_VIEWER"
+msgstr "Visu_points.png"
+
+msgid "ICON_GAUSS_POINTS"
+msgstr "Visu_gauss_points.png"
+
+msgid "ICON_VVTK_INTERACTOR_STYLE_SWITCH"
+msgstr "Visu_vvtk_switch.png"
+
+msgid "ICON_VVTK_SELECTION_MODE_SWITCH"
+msgstr "Visu_points.png"
+
+msgid "ICON_VVTK_PLANE_SEGMENTATION_SWITCH"
+msgstr "Visu_PlaneSegmentation.png"
+
+msgid "ICON_VVTK_SPHERE_SEGMENTATION_SWITCH"
+msgstr "Visu_SphereSegmentation.png"
+
+msgid "ICON_VVTK_RECORDING_START"
+msgstr "Visu_recording_start.png"
+
+msgid "ICON_VVTK_RECORDING_PLAY"
+msgstr "Visu_recording_play.png"
+
+msgid "ICON_VVTK_RECORDING_PAUSE"
+msgstr "Visu_recording_pause.png"
+
+msgid "ICON_VVTK_RECORDING_STOP"
+msgstr "Visu_recording_stop.png"
+
+msgid "ICON_LOAD_TEXTURE"
+msgstr "Visu_load_texture.png"
+# Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
-msgid "BUT_OK"
-msgstr "OK"
-
-msgid "BUT_APPLY"
-msgstr "Apply"
-
-msgid "BUT_CLOSE"
-msgstr "Close"
-
-msgid "BUT_CANCEL"
-msgstr "Cancel"
-
msgid "WRN_VISU"
msgstr "Post-Pro Warning"
msgid "VISU_PREF_MED_FULL_LOAD"
msgstr "Full MED loading"
-msgid "VISU_PREF_REPRESENT_PROPS"
+msgid "VISU_REPRESENT_PROPS"
msgstr "Representation properties"
-msgid "VISU_PREF_SHADING"
+msgid "VISU_USE_SHADING"
msgstr "Use Shading"
+msgid "VISU_SHRINK"
+msgstr "Shrink"
+
#: VisuGUI.cxx
+msgid "VisuGUI::MEN_IMPORT"
+msgstr "Import"
+
msgid "VisuGUI::MEN_IMPORT_FROM_FILE"
+msgstr "MED file"
+
+msgid "VisuGUI::IMPORT_FROM_FILE"
msgstr "Import from File"
-msgid "VisuGUI::MEN_EXPLORE_MED_FILE"
-msgstr "Explore MED File"
+msgid "VisuGUI::USE_BUILD_PROGRESS"
+msgstr "Use build progress"
msgid "VisuGUI::MEN_IMPORT_TABLE"
-msgstr "Import table from File"
+msgstr "Table from file"
msgid "VisuGUI::MEN_SCALAR_MAP"
msgstr "Scalar Map"
msgid "VisuGUI::MEN_VISUALIZATION"
msgstr "Visualization"
+msgid "VisuGUI::TOOL_IMPORT"
+msgstr "Import Toolbar"
+
msgid "VisuGUI::TOOL_VISUALISATION"
msgstr "Visualization Toolbar"
msgid "VisuGUI::MEN_ARRANGE_ACTORS"
msgstr "Arrange Actors"
+msgid "VisuGUI::MEN_PLOT3D_FROM_CUTPLANE"
+msgstr "Plot3d"
-msgid "VisuGUI::ERR_ERROR_IN_THE_FILE"
-msgstr "Error in the file"
msgid "VisuGUI::ERR_ERROR_DURING_EXPORT"
msgstr "Error has been occured during exporting to file"
msgid "VisuGUI_SetupPlot2dDlg::QUE_WANT_SAME_UNITS"
msgstr "Do you want to choose all items with the same units for vertical axis?"
+msgid "INF_VISU"
+msgstr "Post-Pro Info"
+
+msgid "IMPORT_DONE"
+msgstr "Importing is done"
+
+msgid "VisuGUI_Module::MEN_VISUALISATION"
+msgstr "Visualization"
+
+msgid "VisuGUI_Module::TOOL_IMPORT"
+msgstr "Import Toolbar"
+
+msgid "VisuGUI_Module::TOOL_VISUALISATION"
+msgstr "Visualization Toolbar"
+
+msgid "VisuGUI_Module::MEN_SAVE_CONFIGURATION"
+msgstr "Store current configuration"
+
+msgid "VisuGUI_Module::MEN_OVERWRITE_CONFIGURATION"
+msgstr "Overwrite current configuration"
+
+msgid "VisuGUI_Module::MEN_RESTORE_CONFIGURATION"
+msgstr "Restore current configuration"
+
+msgid "VisuGUI_Module::MEN_GAUSS"
+msgstr "Gauss"
+
+msgid "VisuGUI_Module::MEN_GAUSS_NEW_VIEWER"
+msgstr "Points view"
+
+msgid "VisuGUI_Module::MEN_GAUSS_CREATE_PRS"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_TAB_TTL"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL"
+msgstr "Primitive"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_PRIMITIVE_TYPE"
+msgstr "Primitive Type"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_POINTSPRITE"
+msgstr "Point sprite"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_OPENGLPOINT"
+msgstr "OpenGL point"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_GEOMSPHERE"
+msgstr "Geometrical sphere"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_CLAMP"
+msgstr "Maximum Size (Clamp)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAIN_TEXTURE"
+msgstr "Main Texture (16x16)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_ALPHA_TEXTURE"
+msgstr "Alpha Channel Texture (16x16)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_ALPHA_THRESHOLD"
+msgstr "Alpha Channel Threshold"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_RESOLUTION"
+msgstr "Geometrical sphere resolution"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_FACE_LIMIT"
+msgstr "Notify when number of faces exceeds"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_SIZE_GROUP_TTL"
+msgstr "Size"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_MIN_SIZE"
+msgstr "Range value for min size (%)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAX_SIZE"
+msgstr "Range value for max size (%)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAGNIFICATION"
+msgstr "Magnification (%)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_INCREMENT"
+msgstr "+/- Ratio"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_GEOM_GROUP_TTL"
+msgstr "Geometry"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_SIZE"
+msgstr "Size of points (%)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_COLOR"
+msgstr "Color"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_DEFORMED_SHAPE_GROUP_TTL"
+msgstr "Deformed Shape"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_SCALE_FACTOR"
+msgstr "Scale factor"
+
+msgid "VisuGUI_Module::VISU_GAUSS_SCALAR_BAR_PREF_TAB_TTL"
+msgstr "Gauss Points Scalar Bar"
+
+msgid "VisuGUI_Module::VISU_GAUSS_SCALAR_BAR_PREF_GROUP_TTL"
+msgstr "Gauss Points Scalar Bar"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_ACTIVE_BAR"
+msgstr "Active bar"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_LOCAL"
+msgstr "Local"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_GLOBAL"
+msgstr "Global"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_DISPLAY_GLOBAL"
+msgstr "Display global bar"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_SCALAR_BAR_MODE"
+msgstr "Scalar bar mode"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_BICOLOR"
+msgstr "Bicolor"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_RAINBOW"
+msgstr "Rainbow"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_SPACING"
+msgstr "Spacing"
+
+msgid "VisuGUI_Module::VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL"
+msgstr "Inside Cursor"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAGNIFICATION_GROUP_TTL"
+msgstr "Magnification (Inside and Outside)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL"
+msgstr "Outside Cursor"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_UNIFORM_COLOR"
+msgstr "Uniform Color"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_COLOR_GROUP_TTL"
+msgstr "Color"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_TAB_TTL"
+msgstr "Picking"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_CURSOR_GROUP_TTL"
+msgstr "Cursor"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_CURSOR_SIZE"
+msgstr "Size of the cursor"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_PYRAMID_HEIGHT"
+msgstr "Height of the pyramids"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_SELECTION_COLOR"
+msgstr "Selection cursor color"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_TOLERANCE_GROUP_TTL"
+msgstr "Tolerance"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_POINT_SELECTION_TOLERANCE"
+msgstr "Point selection tolerance"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_INFO_WINDOW_GROUP_TTL"
+msgstr "Information window"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_TRANSPARENCY"
+msgstr "Transparency"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_POSITION"
+msgstr "Position"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_BELOW_POINT"
+msgstr "Centered below the point"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_TOP_LEFT_CORNER"
+msgstr "Top-left corner of the 3D view"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_CAMERA_GROUP_TTL"
+msgstr "Movement of the camera"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_ZOOM_FACTOR"
+msgstr "Zoom at first selected point (ratio)"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_STEP_NUMBER"
+msgstr "Number of steps between two positions"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_PARENT_MESH_TTL"
+msgstr "Parent mesh element"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_DISPLAY_PARENT_MESH"
+msgstr "Display parent mesh element"
+
+msgid "VisuGUI_Module::VISU_MOUSE_PREF_TAB_TLT"
+msgstr "Navigation"
+
+msgid "VisuGUI_Module::VISU_MOUSE_PREF_GROUP_TLT"
+msgstr "Mouse"
+
+msgid "VisuGUI_Module::VISU_MOUSE_PREF"
+msgstr "Mouse behaviour"
+
+msgid "VisuGUI_Module::VISU_MOUSE_PREF_STANDARD"
+msgstr "Salome standard controls"
+
+msgid "VisuGUI_Module::VISU_MOUSE_PREF_KEYBOARD_FREE"
+msgstr "Keyboard free"
+
+msgid "VisuGUI_Module::VISU_KEYBOARD_PREF_GROUP_TTL"
+msgstr "Keyboard"
+
+msgid "VisuGUI_Module::VISU_KEYBOARD_PREF"
+msgstr "[+]/[-] Speed increment"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF"
+msgstr "Spacemouse"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_1"
+msgstr "Decrease speed increment"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_2"
+msgstr "Increase speed increment"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_3"
+msgstr "Decrease Gauss points magnification"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_4"
+msgstr "Increase Gauss points magnification"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_5"
+msgstr "Dominant / combined switch"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_1"
+msgstr "Button 1"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_2"
+msgstr "Button 2"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_3"
+msgstr "Button 3"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_4"
+msgstr "Button 4"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_5"
+msgstr "Button 5"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_6"
+msgstr "Button 6"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_7"
+msgstr "Button 7"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_8"
+msgstr "Button 8"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_10"
+msgstr "Button 10"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_11"
+msgstr "Button 11"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_*"
+msgstr "Button *"
+
+msgid "VisuGUI_Module::VISU_CAMERA_PREF_GROUP_TTL"
+msgstr "Camera movements"
+
+msgid "VisuGUI_Module::VISU_CAMERA_MOVE_PREF"
+msgstr "Number of steps between two positions"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_TAB_TTL"
+msgstr "Recorder"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_GROUP_TTL"
+msgstr "Settings"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_RECORDING_MODE"
+msgstr "Mode"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_SKIPPED_FRAMES"
+msgstr "Recording at a given FPS"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_ALL_DISLPAYED_FRAMES"
+msgstr "Recording all displayed frames"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_FPS"
+msgstr "FPS"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_QUALITY"
+msgstr "Quality"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_PROGRESSIVE"
+msgstr "Progressive"
+
+msgid "VisuGUI_GaussPointsDlg::DLG_PREF_TITLE"
+msgstr "Gauss Points Preferences"
+
+msgid "VisuGUI_GaussPointsDlg::DLG_PROP_TITLE"
+msgstr "Gauss Points Properties"
+
+msgid "VisuGUI_BuildProgressDlg::DLG_BUILD_PROGRESS_TITLE"
+msgstr "Build progress"
+
+msgid "VisuGUI_BuildProgressDlg::IMPORT_SETTINGS"
+msgstr "Settings"
+
+msgid "VisuGUI_BuildProgressDlg::FILE_NAME"
+msgstr "Import file : "
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_AT_ONCE"
+msgstr "Build at once"
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_ALL"
+msgstr "Build all"
+
+msgid "VisuGUI_BuildProgressDlg::IMPORT_PROGRESS"
+msgstr "Import progress"
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_ENTITIES"
+msgstr "Build entities"
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_FIELDS"
+msgstr "Build fields"
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_GROUPS"
+msgstr "Build groups"
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_MINMAX"
+msgstr "Build min/max"
+
+msgid "VisuGUI_BuildProgressDlg::IMPORT_TIME"
+msgstr "Time"
+
+msgid "VisuGUI_BuildProgressDlg::TIME"
+msgstr "Elapsed time : "
+
+msgid "VisuGUI_BuildProgressDlg::IMPORT_FROM_FILE"
+msgstr "Import from File"
+
+msgid "VisuGUI_BuildProgressDlg::FLT_ALL_FILES"
+msgstr "All Files (*.*)"
+
+msgid "VisuGUI_BuildProgressDlg::FLT_MED_FILES"
+msgstr "MED Files (*.med)"
+
+msgid "VisuGUI_BuildProgressDlg::CLOSE_AT_FINISH"
+msgstr "Close dialog at finish"
+
+msgid "VisuGUI_BuildProgressDlg::START"
+msgstr "Start"
+
+msgid "VisuGUI_BuildProgressDlg::CLOSE"
+msgstr "Close"
+
+msgid "VisuGUI_BuildProgressDlg::HELP"
+msgstr "Help"
+
+msgid "VisuGUI_BuildProgressDlg::ERR_ERROR_IN_THE_FILE"
+msgstr "Error in the file"
+
+msgid "VVTK_RecorderDlg::DLG_RECORDER_TITLE"
+msgstr "Recorder"
+
+msgid "VVTK_RecorderDlg::SETTINGS"
+msgstr "Settings"
+
+msgid "VVTK_RecorderDlg::FILE_NAME"
+msgstr "Save to file : "
+
+msgid "VVTK_RecorderDlg::FLT_ALL_FILES"
+msgstr "All Files (*.*)"
+
+msgid "VVTK_RecorderDlg::FLT_AVI_FILES"
+msgstr "AVI Files (*.avi)"
+
+msgid "VVTK_RecorderDlg::RECORDING_MODE"
+msgstr "Mode : "
+
+msgid "VVTK_RecorderDlg::SKIPPED_FRAMES"
+msgstr "Recording at a given FPS"
+
+msgid "VVTK_RecorderDlg::ALL_DISLPAYED_FRAMES"
+msgstr "Recording all displayed frames"
+
+msgid "VVTK_RecorderDlg::FPS"
+msgstr "FPS : "
+
+msgid "VVTK_RecorderDlg::QUALITY"
+msgstr "Quality : "
+
+msgid "VVTK_RecorderDlg::PROGRESSIVE"
+msgstr "Progressive"
+
+msgid "VVTK_RecorderDlg::START"
+msgstr "Start"
+
+msgid "VVTK_RecorderDlg::CLOSE"
+msgstr "Close"
+
+msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_TITLE"
+msgstr "Change Transparency"
+
+msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_TRANSPARENT"
+msgstr "Transparent"
+
+msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_OPAQUE"
+msgstr "Opaque"
+
+msgid "VisuGUI_TransparencyDlg::BUT_CLOSE"
+msgstr "Close"
+
+msgid "VVTK_ViewManager::VTK_VIEW_TITLE"
+msgstr "Gauss scene:%1 - viewer:%2"
+
+msgid "VVTK_MainWindow::LBL_TOOLBAR_RECORD_LABEL"
+msgstr "Recording Operations"
+
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_START"
+msgstr "Start recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_START"
+msgstr "Start recording"
+
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_PLAY"
+msgstr "Play recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_PLAY"
+msgstr "Play recording"
+
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_PAUSE"
+msgstr "Pause recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_PAUSE"
+msgstr "Pause recording"
+
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_STOP"
+msgstr "Stop recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_STOP"
+msgstr "Stop recording"
+
+msgid "VVTK_MainWindow1::LBL_TOOLBAR_GAUSS_LABEL"
+msgstr "Gauss Viewer Tools"
+
+msgid "VVTK_MainWindow1::MNU_VVTK_INTERACTOR_STYLE_SWITCH"
+msgstr "Interaction Style Switch"
+
+msgid "VVTK_MainWindow1::DSC_VVTK_INTERACTOR_STYLE_SWITCH"
+msgstr "Interaction Style Switch"
+
+msgid "VVTK_MainWindow1::MNU_VVTK_SELECTION_MODE_SWITCH"
+msgstr "Selection Mode Switch"
+
+msgid "VVTK_MainWindow1::DSC_VVTK_SELECTION_MODE_SWITCH"
+msgstr "Selection Mode Switch"
+
+msgid "VVTK_MainWindow1::MNU_VVTK_PLANE_SEGMENTATION_SWITCH"
+msgstr "Plane Segmentation"
+
+msgid "VVTK_MainWindow1::DSC_VVTK_PLANE_SEGMENTATION_SWITCH"
+msgstr "Plane Segmentation"
+
+msgid "VVTK_MainWindow1::MNU_VVTK_SPHERE_SEGMENTATION_SWITCH"
+msgstr "Sphere Segmentation"
+
+msgid "VVTK_MainWindow1::DSC_VVTK_SPHERE_SEGMENTATION_SWITCH"
+msgstr "Sphere Segmentation"
+
+msgid "VVTK_PrimitiveBox::PRIMITIVE_TITLE"
+msgstr "Primitive"
+
+msgid "VVTK_PrimitiveBox::POINT_SPRITE"
+msgstr "Point Sprite"
+
+msgid "VVTK_PrimitiveBox::OPENGL_POINT"
+msgstr "OpenGL Point"
+
+msgid "VVTK_PrimitiveBox::GEOMETRICAL_SPHERE"
+msgstr "Geometrical Sphere"
+
+msgid "VVTK_PrimitiveBox::CLAMP"
+msgstr "Maximum Size (Clamp) : "
+
+msgid "VVTK_PrimitiveBox::MAIN_TEXTURE"
+msgstr "Main Texture (16x16) : "
+
+msgid "VVTK_PrimitiveBox::ALPHA_TEXTURE"
+msgstr "Alpha Channel Texture (16x16) : "
+
+msgid "VVTK_PrimitiveBox::ALPHA_THRESHOLD"
+msgstr "Alpha Channel Threshold : "
+
+msgid "VVTK_PrimitiveBox::RESOLUTION"
+msgstr "Resolution : "
+
+msgid "VVTK_PrimitiveBox::FACE_NUMBER"
+msgstr "Number of faces : "
+
+msgid "VVTK_PrimitiveBox::FACE_LIMIT"
+msgstr "Notify when number of faces exceeds : "
+
+msgid "VVTK_SizeBox::SIZE_TITLE"
+msgstr "Size"
+
+msgid "VVTK_SizeBox::OUTSIDE_SIZE"
+msgstr "Percentage of normal size(%) : "
+
+msgid "VVTK_SizeBox::GEOM_SIZE"
+msgstr "Size of points (%) : "
+
+msgid "VVTK_SizeBox::MIN_SIZE"
+msgstr "Range values for min size (%) : "
+
+msgid "VVTK_SizeBox::MAX_SIZE"
+msgstr "max size (%) : "
+
+msgid "VVTK_SizeBox::MAGNIFICATION"
+msgstr "Magnification (%) : "
+
+msgid "VVTK_SizeBox::INCREMENT"
+msgstr "+/- Ratio : "
+
+msgid "VVTK_SizeBox::COLOR_TITLE"
+msgstr "Color"
+
+msgid "VVTK_SizeBox::UNIFORM_COLOR"
+msgstr "Uniform Color"
+
+msgid "VVTK_SizeBox::COLOR"
+msgstr "Color : "
+
+msgid "VisuGUI_GaussPointsDlg::&Cancel"
+msgstr ""
+
+msgid "VisuGUI_GaussPointsDlg::&OK"
+msgstr ""
+
+msgid "VisuGUI_GaussPointsDlg::WARNING"
+msgstr "Warning"
+
+msgid "VisuGUI_GaussPointsDlg::DLG_TITLE"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_GaussPointsDlg::GAUSS_POINTS_TAB"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_GaussPointsDlg::SCALAR_BAR_TAB"
+msgstr "Scalar Bar"
+
+msgid "VisuGUI_GaussPointsDlg::PRS_TITLE"
+msgstr "Presentation"
+
+msgid "VisuGUI_GaussPointsDlg::RESULTS"
+msgstr "Results"
+
+msgid "VisuGUI_GaussPointsDlg::GEOMETRY"
+msgstr "Geometry"
+
+msgid "VisuGUI_GaussPointsDlg::DEFORMED_SHAPE"
+msgstr "Deformed Shape"
+
+msgid "VisuGUI_GaussPointsDlg::DEFORMED_SHAPE_TITLE"
+msgstr "Deformed Shape"
+
+msgid "VisuGUI_GaussPointsDlg::SCALE_FACTOR"
+msgstr "Scale Factor :"
+
+msgid "VisuGUI_GaussScalarBarPane::ACTIVE_BAR_GRP"
+msgstr "Active bar"
+
+msgid "VisuGUI_GaussScalarBarPane::LOCAL"
+msgstr "Local"
+
+msgid "VisuGUI_GaussScalarBarPane::GLOBAL"
+msgstr "Global"
+
+msgid "VisuGUI_GaussScalarBarPane::DISPLAYED"
+msgstr "Displayed"
+
+msgid "VisuGUI_GaussScalarBarPane::SCALAR_RANGE_GRP"
+msgstr "Scalar range"
+
+msgid "VisuGUI_GaussScalarBarPane::LOGARITHMIC_SCALING"
+msgstr "Logarithmic scaling"
+
+msgid "VisuGUI_GaussScalarBarPane::FIELD_RANGE_BTN"
+msgstr "Use field range"
+
+msgid "VisuGUI_GaussScalarBarPane::IMPOSED_RANGE_BTN"
+msgstr "Use imposed range"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_MIN"
+msgstr "Min:"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_MAX"
+msgstr "Max:"
+
+msgid "VisuGUI_GaussScalarBarPane::COLORS_LABELS_GRP"
+msgstr "Colors and labels"
+
+msgid "VisuGUI_GaussScalarBarPane::BICOLOR"
+msgstr "Bicolor"
+
+msgid "VisuGUI_GaussScalarBarPane::RAINBOW"
+msgstr "Rainbow"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_NB_COLORS"
+msgstr "Nb. of colors:"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_NB_LABELS"
+msgstr "Nb. of labels:"
+
+msgid "VisuGUI_GaussScalarBarPane::ORIENTATION_GRP"
+msgstr "Orientation"
+
+msgid "VisuGUI_GaussScalarBarPane::VERTICAL_BTN"
+msgstr "Vertical"
+
+msgid "VisuGUI_GaussScalarBarPane::HORIZONTAL_BTN"
+msgstr "Horizontal"
+
+msgid "VisuGUI_GaussScalarBarPane::ORIGIN_GRP"
+msgstr "Origin"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_X"
+msgstr "X:"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_Y"
+msgstr "Y:"
+
+msgid "VisuGUI_GaussScalarBarPane::DIMENSIONS_GRP"
+msgstr "Dimensions"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_WIDTH"
+msgstr "Width:"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_HEIGHT"
+msgstr "Height:"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_SPACING"
+msgstr "Spacing:"
+
+msgid "VisuGUI_GaussScalarBarPane::SAVE_DEFAULT_CHK"
+msgstr "Save as default values"
+
+msgid "VVTK_ViewWindow::LBL_TOOLBAR_LABEL"
+msgstr "GAUSS viewer tools"
+
+msgid "VVTK_SegmentationCursorDlg::SEGMENTATION_CURSOR_DLG_TITLE"
+msgstr "Segmentation Cursor"
+
+msgid "VVTK_SegmentationCursorDlg::ORIGIN_TITLE"
+msgstr "Origin"
+
+msgid "VVTK_SegmentationCursorDlg::ORIGIN_X"
+msgstr "X: "
+
+msgid "VVTK_SegmentationCursorDlg::ORIGIN_Y"
+msgstr "Y: "
+
+msgid "VVTK_SegmentationCursorDlg::ORIGIN_Z"
+msgstr "Z: "
+
+msgid "VVTK_SegmentationCursorDlg::DIRECTION_TITLE"
+msgstr "Direction"
+
+msgid "VVTK_SegmentationCursorDlg::DIRECTION_DX"
+msgstr "DX: "
+
+msgid "VVTK_SegmentationCursorDlg::DIRECTION_DY"
+msgstr "DY: "
+
+msgid "VVTK_SegmentationCursorDlg::DIRECTION_DZ"
+msgstr "DZ: "
+
+msgid "VVTK_SegmentationCursorDlg::DEPTH_TITLE"
+msgstr "Depth"
+
+msgid "VVTK_SegmentationCursorDlg::DEPTH"
+msgstr "Depth of the cursor: "
+
+msgid "VVTK_SegmentationCursorDlg::RADIUS_TITLE"
+msgstr "Radius"
+
+msgid "VVTK_SegmentationCursorDlg::RADIUS"
+msgstr "Radius of the cursor :"
+
+msgid "VVTK_SegmentationCursorDlg::RATIO"
+msgstr "+/- Ratio :"
+
+msgid "VVTK_SegmentationCursorDlg::SEGMENTATION_CURSOR_TAB"
+msgstr "Segmentation Cursor"
+
+msgid "VVTK_SegmentationCursorDlg::GAUSS_POINTS_TAB"
+msgstr "Gauss Points"
+
+msgid "VVTK_SegmentationCursorDlg::INSIDE_GAUSS_POINTS"
+msgstr "Inside Cursor Gauss Points Presentation"
+
+msgid "VVTK_SegmentationCursorDlg::OUTSIDE_GAUSS_POINTS"
+msgstr "Outside Cursor Gauss Points Presentation"
+
+msgid "VVTK_SegmentationCursorDlg::MAGNIFICATION_TITLE"
+msgstr "Magnification"
+
+msgid "VVTK_SegmentationCursorDlg::MAGNIFICATION"
+msgstr "Magnification (%) : "
+
+msgid "VVTK_SegmentationCursorDlg::INCREMENT"
+msgstr "+/- Ratio : "
+
+msgid "VVTK_PickingDlg::PICKING_DLG_TITLE"
+msgstr "Picking"
+
+msgid "VVTK_PickingDlg::CURSOR_TITLE"
+msgstr "Cursor"
+
+msgid "VVTK_PickingDlg::CURSOR_SIZE"
+msgstr "Size of the cursor :"
+
+msgid "VVTK_PickingDlg::PYRAMID_HEIGHT"
+msgstr "Height of the pyramids :"
+
+msgid "VVTK_PickingDlg::SELECTION_COLOR"
+msgstr "Selection cursor color :"
+
+msgid "VVTK_PickingDlg::TOLERANCE_TITLE"
+msgstr "Tolerance"
+
+msgid "VVTK_PickingDlg::POINT_TOLERANCE"
+msgstr "Point tolerance :"
+
+msgid "VVTK_PickingDlg::INFO_WINDOW_TITLE"
+msgstr "Information window"
+
+msgid "VVTK_PickingDlg::TRANSPARENCY"
+msgstr "Transparency :"
+
+msgid "VVTK_PickingDlg::POSITION"
+msgstr "Position :"
+
+msgid "VVTK_PickingDlg::BELOW_POINT"
+msgstr "Centered below the point"
+
+msgid "VVTK_PickingDlg::TOP_LEFT_CORNER"
+msgstr "Top-left corner of the 3D view"
+
+msgid "VVTK_PickingDlg::CAMERA_TITLE"
+msgstr "Movement of the camera"
+
+msgid "VVTK_PickingDlg::ZOOM_FACTOR"
+msgstr "Zoom at first selected point (ratio) :"
+
+msgid "VVTK_PickingDlg::STEP_NUMBER"
+msgstr "Number of steps between two positions :"
+
+msgid "VVTK_PickingDlg::PARENT_MESH_TITLE"
+msgstr "Parent mesh element"
+
+msgid "VVTK_PickingDlg::DISPLAY_PARENT_MESH"
+msgstr "Display parent mesh element"
+
+msgid "VisuGUI_Module::TOT_DESK_FILE_SAVE_GUI_STATE"
+msgstr "Save VISU state"
+
+msgid "VisuGUI_Module::MEN_DESK_FILE_SAVE_GUI_STATE"
+msgstr "Save VISU state"
+
+msgid "VisuGUI_Module::PRP_DESK_FILE_SAVE_GUI_STATE"
+msgstr "Saves current state of viewers, displayed objects, etc."
+
+msgid "VISU_MESH"
+msgstr "Mesh"
+
+msgid "VISU_SCALAR_MAP"
+msgstr "Scalar Map"
+
+msgid "VISU_ISO_SURFACES"
+msgstr "Iso Surfaces"
+
+msgid "VISU_CUT_PLANES"
+msgstr "Cut Planes"
+
+msgid "VISU_CUT_LINES"
+msgstr "Cut Lines"
+
+msgid "VISU_DEFORMED_SHAPE"
+msgstr "Deformed Shape"
+
+msgid "VISU_VECTORS"
+msgstr "Vectors"
+
+msgid "VISU_STREAM_LINES"
+msgstr "Stream Lines"
+
+msgid "VISU_PLOT3D"
+msgstr "Plot3D"
+
+msgid "VISU_SCALAR_MAP_ON_DEFORMED_SHAPE"
+msgstr "Scalar Map on Def. Shape"
\ No newline at end of file
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "SalomeApp_Application.h"
#include "SalomeApp_DataModel.h"
#include "SalomeApp_Study.h"
+#include "SalomeApp_CheckFileDlg.h"
#include "LightApp_SelectionMgr.h"
#include "LightApp_Selection.h"
#include "LightApp_Preferences.h"
#include "VisuGUI_PopupTools.h"
#include "VisuGUI_NameDlg.h"
-#include "VisuGUI_FileDlg.h"
#include "VisuGUI_CursorDlg.h"
#include "VisuGUI_Selection.h"
#include "VisuGUI_TimeAnimation.h"
#include "VisuGUI_Timer.h"
+#include "VVTK_ViewModel.h"
+
using namespace VISU;
#ifdef _DEBUG_
if(MYDEBUG) MESSAGE("VisuGUI::OnImportFromFile()");
if ( CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this)) )
return;
+
+ SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
- VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
- aBuildProgressDlg->setGenerator( GetVisuGen(this) );
- aBuildProgressDlg->show();
-}
-
-
-void
-VisuGUI::
-OnExploreMEDFile()
-{
- if(MYDEBUG) MESSAGE("VisuGUI::OnExploreMEDFile()");
- _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
- if ( CheckLock(aStudy,GetDesktop(this)) )
- return;
-
- SALOME_MED::MED_Gen_var aGen = GetMEDEngine();
-
+ // Get file name
QStringList aFilter;
- aFilter.append( tr("FLT_MED_FILES") );
- aFilter.append( tr("FLT_ALL_FILES") );
-
- QFileInfo aFileInfo =
- SUIT_FileDlg::getFileName(GetDesktop(this),
- "",
- aFilter,
- tr("MEN_EXPLORE_MED_FILE"),
- true);
- if(aFileInfo.exists()){
- application()->putInfo( tr("MEN_EXPLORE_MED_FILE") + " " + aFileInfo.filePath() + "..." );
- std::string aStudyName = aStudy->Name();
- try
+ aFilter.append( tr( "FLT_MED_FILES" ) );
+ aFilter.append( tr( "FLT_ALL_FILES" ) );
+
+ bool toUseBuildProgress = aResourceMgr->booleanValue("VISU", "use_build_progress", false);
+
+ SalomeApp_CheckFileDlg* fd = new SalomeApp_CheckFileDlg( GetDesktop(this), true, tr("USE_BUILD_PROGRESS") );
+ fd->setCaption( tr( "IMPORT_FROM_FILE" ) );
+ fd->setFilters( aFilter );
+ fd->SetChecked( toUseBuildProgress );
+ fd->exec();
+ QFileInfo aFileInfo( fd->selectedFile() );
+ toUseBuildProgress = fd->IsChecked();
+ delete fd;
+
+ // Check the file name
+ if ( !aFileInfo.exists() )
+ return;
+
+ if ( !toUseBuildProgress )
{
- aGen->readStructFileWithFieldType(aFileInfo.filePath(),aStudyName.c_str());
+ bool toBuildFields = aResourceMgr->booleanValue( "VISU", "build_fields", true );
+ bool toBuildMinMax = aResourceMgr->booleanValue( "VISU", "build_min_max", true );
+ bool toBuildGroups = aResourceMgr->booleanValue( "VISU", "build_groups", true );
+ bool toBuildAll = aResourceMgr->booleanValue( "VISU", "full_med_loading", false );
+ bool toBuildAtOnce = aResourceMgr->booleanValue( "VISU", "build_at_once", false );
+
+ QString anInfo("Importing From File " + aFileInfo.filePath() + "..." );
+ application()->putInfo( anInfo );
+
+ QApplication::setOverrideCursor(Qt::waitCursor);
+ VISU::Result_var aResult = GetVisuGen(this)->CreateResult( aFileInfo.filePath() );
+
+ if (CORBA::is_nil(aResult.in())) {
+ SUIT_MessageBox::warn1(GetDesktop(this),
+ tr("WRN_VISU"),
+ VisuGUI_BuildProgressDlg::tr("ERR_ERROR_IN_THE_FILE"),
+ tr("BUT_OK"));
+ QApplication::restoreOverrideCursor();
+ }else{
+ aResult->SetBuildFields( toBuildFields, toBuildMinMax );
+ aResult->SetBuildGroups( toBuildGroups );
+ aResult->Build( toBuildAll, toBuildAtOnce );
+
+ UpdateObjBrowser(this);
+ application()->putInfo( anInfo + tr("INF_DONE"));
+ QApplication::restoreOverrideCursor();
+ }
}
- catch(...)
+ else
{
- SUIT_MessageBox::warn1(GetDesktop(this),
- tr("WRN_VISU"),
- tr("ERR_ERROR_IN_THE_FILE"),
- tr("BUT_OK"));
+ VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
+ aBuildProgressDlg->setFileName( aFileInfo.filePath() );
+ aBuildProgressDlg->setGenerator( GetVisuGen(this) );
+ aBuildProgressDlg->show();
}
- application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
- getApp()->updateObjectBrowser(true); // as need to update MED tree
- getApp()->updateActions();
- }
}
-
void
VisuGUI::
OnImportTableFromFile()
_PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject);
for (; aIter->More(); aIter->Next()) {
_PTR(SObject) aTblObj = aIter->Value();
- if ( aTblObj ) {
+ if( aTblObj ) {
_PTR(GenericAttribute) anAttr;
if (aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
+
+ _PTR(ChildIterator) aChildIter = aStudy->NewChildIterator( aTblObj );
+ SalomeApp_Study* salome_study = GetAppStudy( theModule );
+ for( aChildIter->InitEx( false ); aChildIter->More(); aChildIter->Next() ){
+ salome_study->deleteReferencesTo( aChildIter->Value() );
+ _PTR(SObject) aSO = aChildIter->Value();
+ if(aSO){
+ if (getValue(aSO, "myComment") == QString("CURVE")) {
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSO);
+ if(!CORBA::is_nil(aCORBAObject)){
+ PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+ VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>(aServant.in());
+ if(pCrv){
+ PlotRemoveCurve(theModule,pCrv);
+ }
+ }
+ }
+ }
+
+ }
+
aBuilder->RemoveObjectWithChildren( aTblObj ); // We should have only one child
- UpdateObjBrowser(theModule,true,aTblObj);
+
+ //UpdateObjBrowser(theModule,true,aTblObj);
break;
}
}
return;
// create a VTK view window if it does not exist
- GetViewWindow( this, /*create=*/true );
+ SVTK_ViewWindow* aViewWindow = GetViewWindow<SVTK_Viewer>(this);
- CreateMesh(this, anIO);
+ // create mesh presentation and display it in aViewWindow
+ CreateMesh(this, anIO, aViewWindow);
}
void
return;
// create a VTK view window if it does not exist
- GetViewWindow( this, /*create=*/true );
+ SVTK_ViewWindow* aViewWindow = GetViewWindow<SVTK_Viewer>(this);
// Get selected SObject
LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
if (anIO.IsNull() || !anIO->hasEntry())
return;
- CreateMesh(this, anIO);
+ // create mesh presentation and display it in aViewWindow
+ CreateMesh(this, anIO, aViewWindow);
}
}
{
if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs");
+ LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
+ if (!mgr) return;
+
QApplication::setOverrideCursor(Qt::waitCursor);
+
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
+
SALOME_ListIO aSel, aList;
- LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
- mgr->selectedObjects( aSel );
+ mgr->selectedObjects(aSel);
+ extractContainers(aSel, aList);
- extractContainers( aSel, aList );
+ for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
+ Handle(SALOME_InteractiveObject) anIO = it.Value();
+ CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this), anIO->getEntry());
- Handle(SALOME_InteractiveObject) anIO;
- for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
- anIO = it.Value();
- CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
- if ( !CORBA::is_nil( anObject ) ) {
+ if (!CORBA::is_nil(anObject)) {
// is it Prs3d object ?
VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
- if(aPrsObject){
+ if (aPrsObject) {
if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Prs3d object");
//UpdateViewer( this, aPrsObject );
- SVTK_ViewWindow* vw = GetViewWindow( this, /*create=*/true );
- if ( vw )
- {
- displayer()->Display( anIO->getEntry() );
+ if (vw) {
+ displayer()->Display(anIO->getEntry());
vw->highlight(anIO, 1);
}
continue;
}
// is it Curve ?
VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in());
- if(aCurve){
+ if (aCurve) {
if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Curve object");
//PlotCurve( this, aCurve, VISU::eDisplay );
- displayer()->Display( anIO->getEntry() );
+ displayer()->Display(anIO->getEntry());
continue;
}
// is it Container ?
VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(anObject).in());
- if(aContainer){
+ if (aContainer) {
if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Container object");
//PlotContainer( this, aContainer, VISU::eDisplay );
- displayer()->Display( anIO->getEntry() );
+ displayer()->Display(anIO->getEntry());
continue;
}
// is it Table ?
VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(anObject).in());
- if(aTable){
+ if (aTable) {
if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Table object");
//PlotTable( this, aTable, VISU::eDisplay );
- displayer()->Display( anIO->getEntry() );
+ displayer()->Display(anIO->getEntry());
continue;
}
}
}
- SVTK_ViewWindow* vw = GetViewWindow( this );
- if ( vw ) {
+
+ if (vw) {
vw->getRenderer()->ResetCameraClippingRange();
vw->Repaint();
}
+
QApplication::restoreOverrideCursor();
}
QApplication::setOverrideCursor(Qt::waitCursor);
- SVTK_ViewWindow* vw = GetViewWindow( this );
- if (vw)
- vw->unHighlightAll();
+ //SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
+ //if (vw)
+ // vw->unHighlightAll();
SALOME_ListIO aList, aSel;
LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
- mgr->selectedObjects( aSel );
+ mgr->selectedObjects(aSel);
+ extractContainers(aSel, aList);
- extractContainers( aSel, aList );
-
- Handle(SALOME_InteractiveObject) anIO;
- for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
- anIO = it.Value();
- CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
- if (!CORBA::is_nil(anObject))
- RemoveScalarBarPosition(this,anObject);
- ErasePrs( this, anObject, false );
+ for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
+ Handle(SALOME_InteractiveObject) anIO = it.Value();
+ CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this), anIO->getEntry());
+ //ErasePrs(this, anObject, /*repaint_view_window = */false);
+ ErasePrs(this, anObject, /*repaint_view_window = */true);
}
- if (vw)
- vw->Repaint();
+ //if (vw)
+ // vw->Repaint();
QApplication::restoreOverrideCursor();
}
OnEraseAll()
{
startOperation( myEraseAll );
- if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
+ if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
vw->unHighlightAll();
if (vtkRenderer *aRen = vw->getRenderer()) {
vtkActor *anActor;
for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
if (anActor->GetVisibility() > 0)
if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
- RemoveScalarBarPosition(this,anVISUActor->GetPrs3d());
+ RemoveScalarBarPosition(this, vw, anVISUActor->GetPrs3d());
anVISUActor->VisibilityOff();
}
}
OnEditScalarMap()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg, 1>(this, anIO, aPrs3d);
}
-
void
VisuGUI::
OnEditDeformedShape()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg, 1>(this, anIO, aPrs3d);
}
void
OnEditScalarMapOnDeformedShape()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::ScalarMapOnDeformedShape_i, VisuGUI_ScalarMapOnDeformedShapeDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::ScalarMapOnDeformedShape_i, VisuGUI_ScalarMapOnDeformedShapeDlg, 1>(this, anIO, aPrs3d);
}
void
OnEditCutPlanes()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg,0>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg, 0>(this, anIO, aPrs3d);
}
-
void
VisuGUI::
OnEditCutLines()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg,0>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg, 0>(this, anIO, aPrs3d);
}
-
void
VisuGUI::
OnEditIsoSurfaces()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg, 1>(this, anIO, aPrs3d);
}
-
void
VisuGUI::
OnEditVectors()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg, 1>(this, anIO, aPrs3d);
}
-
void
VisuGUI::
OnEditStreamLines()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg, 1>(this, anIO, aPrs3d);
}
-
void
VisuGUI::
OnEditPlot3D()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg,0>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg, 0>(this, anIO, aPrs3d);
}
VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
if (!aPrs3d) return;
- SVTK_ViewWindow* vw = GetViewWindow(this);
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
if (!vw) return;
VISU_Actor* anActor = GetActor(aPrs3d, vw);
VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
if (!aPrs3d) return;
- SVTK_ViewWindow* vw = GetViewWindow(this);
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
if (!vw) return;
VISU_Actor* anActor = GetActor(aPrs3d, vw);
VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
if (!aPrsObject) return;
- SVTK_ViewWindow* vw = GetViewWindow(this);
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
if (!vw) return;
VISU_Actor* anActor = GetActor(aPrsObject, vw);
VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
if (!aPrsObject) return;
- SVTK_ViewWindow* vw = GetViewWindow(this);
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
if (!vw) return;
VISU_Actor* anActor = GetActor(aPrsObject, vw);
VisuGUI::
OnDeleteObjects()
{
- _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
+ SalomeApp_Study* anAppStudy = GetAppStudy(this);
+ _PTR(Study) aCStudy = GetCStudy(anAppStudy);
if (CheckLock(aCStudy,GetDesktop(this)))
return;
for (i = 0; i < nbSelected; i++) {
_PTR(SObject) aSObject = aCStudy->FindObjectID(entries[i]);
if (aSObject) {
- DeleteSObject(this, aCStudy, aSObject);
- UpdateObjBrowser(this, true, aSObject);
+ _PTR(SObject) aRefObj;
+ if (aSObject->ReferencedObject(aRefObj)) {
+ // It can be a reference on curve, published under a container.
+ // In this case the curve should be removed from the container.
+ // See bug 10441.
+ CORBA::Object_var aCorbaObj = VISU::GetSelectedObj(anAppStudy, aRefObj->GetID().c_str());
+ if (!CORBA::is_nil(aCorbaObj)) {
+ VISU::Base_var aVisuObj = VISU::Base::_narrow(aCorbaObj);
+ if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TMESH)
+ {
+ DeleteSObject(this, aCStudy, aRefObj);
+ UpdateObjBrowser(this, true, aRefObj);
+ }
+ else if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TCURVE) {
+ VISU::Curve_ptr aCurve = VISU::Curve::_narrow(aVisuObj);
+ _PTR(SObject) aParentSO = aSObject->GetFather();
+ aCorbaObj = VISU::GetSelectedObj(anAppStudy, aParentSO->GetID().c_str());
+ if (!CORBA::is_nil(aCorbaObj) && !CORBA::is_nil(aCurve)) {
+ aVisuObj = VISU::Base::_narrow(aCorbaObj);
+ if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TCONTAINER) {
+ // Container object
+ CORBA::Object_ptr aCnt = VISU::Container::_narrow(aVisuObj);
+ if (!CORBA::is_nil(aCnt)) {
+ VISU::Container_i* aContainer =
+ dynamic_cast<VISU::Container_i*>(VISU::GetServant(aCnt).in());
+ if (aContainer && aContainer->GetNbCurves() > 0) {
+ aContainer->RemoveCurve(aCurve);
+ UpdateObjBrowser(this, true, aParentSO);
+ }
+ }
+ }
+ }
+ }
+ }
+ } else {
+ DeleteSObject(this, aCStudy, aSObject);
+ UpdateObjBrowser(this, true, aSObject);
+ }
}
}
// Finish transaction
aStudyBuilder->CommitCommand();
+ mgr->clearSelected();
}
void
//jfa tmp:VISU::View3D_i::RestoreViewParams(aViewMgr, anIO->getName());
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));//jfa tmp
_PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());//jfa tmp
- VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp
+ if ( aSObj )
+ VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp
}
void
VISU::ScalarMap_i* aPrsObject = dynamic_cast<VISU::ScalarMap_i*>(aServant.in());
if (!aPrsObject) return;
- SVTK_ViewWindow* vw = GetViewWindow(this);
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
if (!vw) return;
VISU_Actor* aActor = GetActor(aPrsObject, vw);
VisuGUI::
OnTimeAnimation()
{
- if(!VISU::GetViewWindow(this))
+ if (!VISU::GetActiveViewWindow<SVTK_ViewWindow>(this))
return;
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
VisuGUI::
OnShowAnimation()
{
- if(!VISU::GetViewWindow(this))
+ if (!VISU::GetActiveViewWindow<SVTK_ViewWindow>(this))
return;
LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
VISU::Mesh_i* aMeshPrs = dynamic_cast<VISU::Mesh_i*>(aPrsObject);
VISU::Mesh_i* aSameMesh = new VISU::Mesh_i(aMeshPrs->GetResult());
aSameMesh->SameAs(aMeshPrs);
- UpdateViewer(this, aSameMesh);
}
break;
case VISU::TSCALARMAP:
VISU::ScalarMap_i* aScalarPrs = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
VISU::ScalarMap_i* aSameScalar = new VISU::ScalarMap_i(aScalarPrs->GetResult(),true);
aSameScalar->SameAs(aScalarPrs);
- UpdateViewer(this, aSameScalar);
}
break;
case VISU::TDEFORMEDSHAPE:
VISU::DeformedShape_i* aDefPrs = dynamic_cast<VISU::DeformedShape_i*>(aPrsObject);
VISU::DeformedShape_i* aSameDeformed = new VISU::DeformedShape_i(aDefPrs->GetResult(),true);
aSameDeformed->SameAs(aDefPrs);
- UpdateViewer(this, aSameDeformed);
}
break;
case VISU::TSCALARMAPONDEFORMEDSHAPE:
{
- VISU::ScalarMapOnDeformedShape_i* aDefPrs = dynamic_cast<VISU::ScalarMapOnDeformedShape_i*>(aPrsObject);
- VISU::ScalarMapOnDeformedShape_i* aSameScalarMapOnDeformed = new VISU::ScalarMapOnDeformedShape_i(aDefPrs->GetResult(),true);
+ VISU::ScalarMapOnDeformedShape_i* aDefPrs =
+ dynamic_cast<VISU::ScalarMapOnDeformedShape_i*>(aPrsObject);
+ VISU::ScalarMapOnDeformedShape_i* aSameScalarMapOnDeformed =
+ new VISU::ScalarMapOnDeformedShape_i(aDefPrs->GetResult(),true);
aSameScalarMapOnDeformed->SameAs(aDefPrs);
- UpdateViewer(this, aSameScalarMapOnDeformed);
}
break;
case VISU::TCUTPLANES:
VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
VISU::CutPlanes_i* aSameCut = new VISU::CutPlanes_i(aCutPrs->GetResult(),true);
aSameCut->SameAs(aCutPrs);
- UpdateViewer(this, aSameCut);
}
break;
case VISU::TCUTLINES:
VISU::CutLines_i* aCutPrs = dynamic_cast<VISU::CutLines_i*>(aPrsObject);
VISU::CutLines_i* aSameCut = new VISU::CutLines_i(aCutPrs->GetResult(),true);
aSameCut->SameAs(aCutPrs);
- UpdateViewer(this, aSameCut);
}
break;
case VISU::TISOSURFACE:
VISU::IsoSurfaces_i* aIsoPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aPrsObject);
VISU::IsoSurfaces_i* aSameIso = new VISU::IsoSurfaces_i(aIsoPrs->GetResult(),true);
aSameIso->SameAs(aIsoPrs);
- UpdateViewer(this, aSameIso);
}
break;
case VISU::TSTREAMLINES:
VISU::StreamLines_i* aLinesPrs = dynamic_cast<VISU::StreamLines_i*>(aPrsObject);
VISU::StreamLines_i* aSameLines = new VISU::StreamLines_i(aLinesPrs->GetResult(),true);
aSameLines->SameAs(aLinesPrs);
- UpdateViewer(this, aSameLines);
}
break;
case VISU::TVECTORS:
VISU::Vectors_i* aVectorsPrs = dynamic_cast<VISU::Vectors_i*>(aPrsObject);
VISU::Vectors_i* aSameVectors = new VISU::Vectors_i(aVectorsPrs->GetResult(),true);
aSameVectors->SameAs(aVectorsPrs);
- UpdateViewer(this, aSameVectors);
}
break;
case VISU::TPLOT3D:
VISU::Plot3D_i* aPlot3DPrs = dynamic_cast<VISU::Plot3D_i*>(aPrsObject);
VISU::Plot3D_i* aSamePlot3D = new VISU::Plot3D_i(aPlot3DPrs->GetResult());
aSamePlot3D->SameAs(aPlot3DPrs);
- UpdateViewer(this, aSamePlot3D);
}
break;
}
VisuGUI::
OnSelectionInfo()
{
- if (GetViewWindow(this))
+ if (GetActiveViewWindow<SVTK_ViewWindow>(this))
(new VisuGUI_SelectionDlg(this))->show();
else
SUIT_MessageBox::warn1(GetDesktop(this),
}
}
if (update) {
- if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
-//if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
- vw->getRenderer()->ResetCameraClippingRange();
- vw->Repaint();
-//}
+ if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
+ vw->getRenderer()->ResetCameraClippingRange();
+ vw->Repaint();
}
}
}
}
}
if (update) {
- if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
-//if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
- vw->getRenderer()->ResetCameraClippingRange();
- vw->Repaint();
-//}
+ if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
+ vw->getRenderer()->ResetCameraClippingRange();
+ vw->Repaint();
}
}
}
VisuGUI::
OnArrangeActors()
{
- SVTK_ViewWindow* vw = GetViewWindow(this);
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
if (vw) {
ArrangeDlg* aDlg = new ArrangeDlg (GetDesktop(this), vw);
aDlg->exec();
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
// Create actions
- createAction( VISU_IMPORT_FROM_FILE, "", QIconSet(),
+ //createAction( VISU_IMPORT_FROM_FILE, "", QIconSet(),
+ // tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false,
+ // this, SLOT(OnImportFromFile()));
+
+ aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_IMPORT_MED"));
+ createAction( VISU_IMPORT_FROM_FILE, tr("IMPORT_FROM_FILE"), QIconSet(aPixmap),
tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false,
this, SLOT(OnImportFromFile()));
- createAction( VISU_EXPLORE_MED, "", QIconSet(),
- tr("MEN_EXPLORE_MED_FILE"), "", (CTRL + Key_M), aParent, false,
- this, SLOT(OnExploreMEDFile()));
-
createAction( VISU_IMPORT_TABLE, "", QIconSet(),
tr("MEN_IMPORT_TABLE"), "", 0, aParent, false,
this, SLOT(OnImportTableFromFile()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GLOBAL_SELECTION"));
createAction( VISU_GLOBAL_SELECTION, tr("MEN_GLOBAL_SELECTION"), QIconSet(aPixmap),
tr("MEN_GLOBAL_SELECTION"), "", 0, aParent, false,
- //this, SLOT(OnEraseAll()));
this);
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PARTIAL_SELECTION"));
createAction( VISU_PARTIAL_SELECTION, tr("MEN_PARTIAL_SELECTION"), QIconSet(aPixmap),
tr("MEN_PARTIAL_SELECTION"), "", 0, aParent, false,
- //this, SLOT(OnEraseAll()));
this);
createAction( VISU_SHOW_ANIMATION, tr("MEN_SHOW_ANIMATION"), QIconSet(),
tr("MEN_SHOW_ANIMATION"), "", 0, aParent, false,
this, SLOT(OnShowAnimation()));
+
+ aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D"));
+ createAction( VISU_PLOT3D_FROM_CUTPLANE, tr("MEN_PLOT3D_FROM_CUTPLANE"), QIconSet(aPixmap),
+ tr("MEN_PLOT3D_FROM_CUTPLANE"), "", 0, aParent, false,
+ this, SLOT(OnPlot3dFromCutPlane()));
}
void
int aMenuId;
aMenuId = createMenu( tr( "MEN_DESK_FILE" ), -1 );
createMenu( separator(), aMenuId, -1, 10 );
- createMenu( VISU_IMPORT_FROM_FILE, aMenuId, 10 ); // import from file
- createMenu( VISU_EXPLORE_MED, aMenuId, 10 ); // explore MED file
- createMenu( VISU_IMPORT_TABLE, aMenuId, 10 ); // import table
+
+ int anImportId = createMenu( tr( "MEN_IMPORT" ), aMenuId, -1, 10 );
+ createMenu( VISU_IMPORT_FROM_FILE, anImportId ); // import from file
+ createMenu( VISU_IMPORT_TABLE, anImportId ); // import table
aMenuId = createMenu( tr( "MEN_VISUALIZATION" ), -1, -1, 30 );
createMenu( VISU_SCALAR_MAP, aMenuId, 10 ); // scalar map
VisuGUI::
createToolBars()
{
- int aToolId = createTool(tr("TOOL_VISUALISATION"));
+ int aToolId = createTool( tr("TOOL_IMPORT") );
+ createTool( VISU_IMPORT_FROM_FILE, aToolId );
+
+ aToolId = createTool(tr("TOOL_VISUALISATION"));
createTool( VISU_SCALAR_MAP, aToolId );
createTool( VISU_DEFORMED_SHAPE, aToolId );
createTool( VISU_VECTORS, aToolId );
QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")";
QString aPrsVisible = "(($type in {'VISU::TMESH' " + aPrsAll + "}) and isVisible)";
QString aPrsInvisible = "(($type in {'VISU::TMESH' " + aPrsAll + "})" + andInvisible + ")";
- QString aComponent = "( selcount=1 and canBeDisplayed and isComponent )";
+ QString aComponent = "( selcount=1 and canBeDisplayed and isVisuComponent )";
QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible +
" or (client='ObjectBrowser' and (" + aTableOrCont + orCurveVisible + "))) ) or " + aComponent;
// 3D presentations commands
QString aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
QString aInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE'}";
- QString aSurfType = " and $type in {'VISU::TMESH'}";
+ QString aSurfFrameType = " and $type in {'VISU::TMESH'}";
+ QString aSurfType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
+ " 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' "
"'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
mgr->setRule( action( VISU_POINTS ) , aRule + aPrsType + aNotPoints, true );
mgr->setRule( action( VISU_WIREFRAME ) , aRule + aPrsType + aNotWirefr, true );
- mgr->setRule( action( VISU_SURFACE ) , aRule + aPrsType + aNotSurfac, true );
+ mgr->setRule( action( VISU_SURFACE ) , aRule + aSurfType + aNotSurfac, true );
mgr->setRule( action( VISU_INSIDEFRAME ) , aRule + aInsideType + aNotInside, true );
- mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfType + aNotSurffr, true );
+ mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfFrameType + aNotSurffr, true );
mgr->setRule( action( VISU_SHRINK ) , aRule + aShrinkType + " and isShrunk=0", true );
mgr->setRule( action( VISU_UNSHRINK ), aRule + aShrinkType + " and isShrunk=1", true );
if (!anIO.IsNull() && anIO->hasEntry()) {
_PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
+ if ( !aSObject )
+ continue;
CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
if (CORBA::is_nil(aCORBAObject)) {
_PTR(GenericAttribute) anAttr;
}
}
}
-
if (nbPrs > 1) {
theMenu->insertSeparator();
action( VISU_MERGE_SCALAR_BARS )->addTo(theMenu);
action( VISU_FREE_SCALAR_BARS )->addTo(theMenu);
}
- theMenu->insertSeparator();
-
- // Check if some (nb > 0) removable objects selected
- if (isOBClient && IsRemovableSelected(this)) {
- action( VISU_DELETE_OBJS )->addTo(theMenu);
- }
-
// Check if some curves selected (for bug PAL10611)
bool isCurves = false;
+ bool isOneCutPlane = false;
SALOME_ListIteratorOfListIO It1 (aListIO);
for (; It1.More() && !isCurves; It1.Next()) {
Handle(SALOME_InteractiveObject)& anIO = It1.Value();
if (!anIO.IsNull() && anIO->hasEntry()) {
_PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
+ if ( !aSObject )
+ continue;
_PTR(GenericAttribute) anAttr;
if (aSObject->FindAttribute(anAttr, "AttributeComment")) {
_PTR(AttributeComment) aComment (anAttr);
VISU::Storable::StrToMap(strIn, pMap);
bool isExist;
VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(pMap,"myType",&isExist).toInt();
- if (isExist && aType == VISU::TCURVE) {
+ if (isExist && aType == VISU::TCURVE) {
isCurves = true;
- }
+ } else {
+ CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this), anIO->getEntry());
+ if (!CORBA::is_nil(anObject)) {
+ VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
+ if (aPrsObject) {
+ if (aPrsObject->GetType() == VISU::TCUTPLANES) {
+ VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
+ if (aCutPrs) {
+ isOneCutPlane = aCutPrs->GetNbPlanes() == 1;
+ }
+ }
+ }
+ }
+ }
}
}
}
+
+ if (isOneCutPlane)
+ action( VISU_PLOT3D_FROM_CUTPLANE )->addTo(theMenu);
+
+ theMenu->insertSeparator();
+
+ // Check if some (nb > 0) removable objects selected
+ if (isOBClient && IsRemovableSelected(this)) {
+ action( VISU_DELETE_OBJS )->addTo(theMenu);
+ }
if (isCurves) {
action( myDisplay )->removeFrom(theMenu);
action( myErase )->removeFrom(theMenu);
CORBA::Object_var anObject = GetSelectedObj( this, &anIO, &aMap);
_PTR(SObject) SO = aCStudy->FindObjectID(anIO->getEntry());
+ if ( !SO )
+ return;
bool isExist;
VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
viewManagers( QStringList& theList ) const
{
theList.clear();
- theList.append( SVTK_Viewer::Type() );
+ // append SVTK viewer only if there is no opened VVTK
+ SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false );
+ if( vm && vm->getViewsCount()>0 )
+ theList.append( VVTK_Viewer::Type() );
+ else
+ theList.append( SVTK_Viewer::Type() );
}
studyActivated();
setMenuShown( true );
setToolShown( true );
+
+ // Reset actions accelerator keys
+ action(VISU_IMPORT_FROM_FILE)->setAccel(QKeySequence(CTRL + Key_I));
+
return true;
}
setMenuShown( false );
setToolShown( false );
+ // Unset actions accelerator keys
+ action(VISU_IMPORT_FROM_FILE)->setAccel(QKeySequence());
+
SalomeApp_Module::deactivateModule( theStudy );
return true;
}
// group: "MED files import"
int importGr = addPreference( tr( "MED files import" ), srangeTab );
setPreferenceProperty( importGr, "columns", 1 );
+ addPreference( tr( "Use build progress" ), importGr, LightApp_Preferences::Bool, "VISU", "use_build_progress" );
addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" );
addPreference( tr( "Build at once" ), importGr, LightApp_Preferences::Bool, "VISU", "build_at_once" );
addPreference( tr( "Build fields" ), importGr, LightApp_Preferences::Bool, "VISU", "build_fields" );
addPreference( tr( "Build groups" ), importGr, LightApp_Preferences::Bool, "VISU", "build_groups" );
addPreference( tr( "Close dialog at finish" ), importGr, LightApp_Preferences::Bool, "VISU", "close_at_finish" );
- // group: "Representation properties"
- int representGr = addPreference( tr( "VISU_PREF_REPRESENT_PROPS" ), srangeTab );
- addPreference( tr( "VISU_PREF_SHADING" ), representGr,
+ // TAB: Representation ; group: "Representation properties"
+ int representationTab = addPreference( tr( "Representation" ) );
+
+ int representGr = addPreference( tr( "VISU_REPRESENT_PROPS" ), representationTab );
+
+ QStringList mesh_modes;
+ mesh_modes.append( "Points" );
+ mesh_modes.append( "Wireframe" );
+ mesh_modes.append( "Insideframe" );
+ mesh_modes.append( "Surfaceframe" );
+ mesh_modes.append( "Surface" );
+ QValueList<QVariant> mesh_indices;
+ mesh_indices.append( 0 );
+ mesh_indices.append( 1 );
+ mesh_indices.append( 3 );
+ mesh_indices.append( 4 );
+ mesh_indices.append( 2 );
+
+ QStringList modes1 = mesh_modes;
+ modes1.remove( "Surfaceframe" );
+ QValueList<QVariant> indices1 = mesh_indices;
+ indices1.remove( 4 );
+
+ QStringList modes2 = modes1;
+ modes2.remove( "Insideframe" );
+ QValueList<QVariant> indices2 = indices1;
+ indices2.remove( 3 );
+
+ QStringList modes3 = modes2;
+ modes3.remove( "Surface" );
+ QValueList<QVariant> indices3 = indices2;
+ indices3.remove( 2 );
+
+
+ int mesh_represent = addPreference( tr( "VISU_MESH" ), representGr, LightApp_Preferences::Selector, "VISU", "mesh_represent" );
+ setPreferenceProperty( mesh_represent, "strings", mesh_modes );
+ setPreferenceProperty( mesh_represent, "indexes", mesh_indices );
+ addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "mesh_shrink" );
+
+ int scalar_map_represent = addPreference( tr( "VISU_SCALAR_MAP" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_map_represent" );
+ setPreferenceProperty( scalar_map_represent, "strings", modes1 );
+ setPreferenceProperty( scalar_map_represent, "indexes", indices1 );
+ addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_map_shrink" );
+
+ int iso_surfaces_represent = addPreference( tr( "VISU_ISO_SURFACES" ), representGr, LightApp_Preferences::Selector, "VISU", "iso_surfaces_represent" );
+ setPreferenceProperty( iso_surfaces_represent, "strings", modes2 );
+ setPreferenceProperty( iso_surfaces_represent, "indexes", indices2 );
+ addPreference( "", representGr, LightApp_Preferences::Space );
+
+ int cut_planes_represent = addPreference( tr( "VISU_CUT_PLANES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_planes_represent" );
+ setPreferenceProperty( cut_planes_represent, "strings", modes2 );
+ setPreferenceProperty( cut_planes_represent, "indexes", indices2 );
+ addPreference( "", representGr, LightApp_Preferences::Space );
+
+ int cut_lines_represent = addPreference( tr( "VISU_CUT_LINES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_lines_represent" );
+ setPreferenceProperty( cut_lines_represent, "strings", modes3 );
+ setPreferenceProperty( cut_lines_represent, "indexes", indices3 );
+ addPreference( "", representGr, LightApp_Preferences::Space );
+
+ int deformed_shape_represent = addPreference( tr( "VISU_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "deformed_shape_represent" );
+ setPreferenceProperty( deformed_shape_represent, "strings", modes1 );
+ setPreferenceProperty( deformed_shape_represent, "indexes", indices1 );
+ addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "deformed_shape_shrink" );
+
+ int vectors_represent = addPreference( tr( "VISU_VECTORS" ), representGr, LightApp_Preferences::Selector, "VISU", "vectors_represent" );
+ setPreferenceProperty( vectors_represent, "strings", modes3 );
+ setPreferenceProperty( vectors_represent, "indexes", indices3 );
+ addPreference( "", representGr, LightApp_Preferences::Space );
+
+ int stream_lines_represent = addPreference( tr( "VISU_STREAM_LINES" ), representGr, LightApp_Preferences::Selector, "VISU", "stream_lines_represent" );
+ setPreferenceProperty( stream_lines_represent, "strings", modes3 );
+ setPreferenceProperty( stream_lines_represent, "indexes", indices3 );
+ addPreference( "", representGr, LightApp_Preferences::Space );
+
+ int plot3d_represent = addPreference( tr( "VISU_PLOT3D" ), representGr, LightApp_Preferences::Selector, "VISU", "plot3d_represent" );
+ setPreferenceProperty( plot3d_represent, "strings", modes2 );
+ setPreferenceProperty( plot3d_represent, "indexes", indices2 );
+ addPreference( "", representGr, LightApp_Preferences::Space );
+
+ int scalar_def_represent = addPreference( tr( "VISU_SCALAR_MAP_ON_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_def_represent" );
+ setPreferenceProperty( scalar_def_represent, "strings", modes2 );
+ setPreferenceProperty( scalar_def_represent, "indexes", indices2 );
+ addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" );
+
+ addPreference( tr( "VISU_USE_SHADING" ), representGr,
LightApp_Preferences::Bool, "VISU", "represent_shading" );
}
if (b == QString("scalar_bar_orientation")) return;
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
float sbX1,sbY1,sbW,sbH;
+ float aTol = 1.00000009999999;
std::string aWarning;
if(b == QString("scalar_bar_vertical_x") || b == QString("scalar_bar_vertical_width")){
sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_x", sbX1);
sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_width", sbW);
- if(sbX1+sbW > 1.0){
+ if(sbX1+sbW > aTol){
aWarning = "Origin and Size Vertical: X+Width > 1\n";
sbX1=0.01;
sbW=0.05;
else if(b == QString("scalar_bar_vertical_y") || b == QString("scalar_bar_vertical_height")){
sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_y", sbY1);
sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_height",sbH);
- if(sbY1+sbH > 1.0){
+ if(sbY1+sbH > aTol){
aWarning = "Origin and Size Vertical: Y+Height > 1\n";
sbY1=0.01;
sbH=0.5;
else if(b == QString("scalar_bar_horizontal_x") || b == QString("scalar_bar_horizontal_width")){
sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_x", sbX1);
sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_width", sbW);
- if(sbX1+sbW > 1.0){
+ if(sbX1+sbW > aTol){
aWarning = "Origin and Size Horizontal: X+Width > 1\n";
sbX1=0.2;
sbW=0.6;
else if(b == QString("scalar_bar_horizontal_y") || b == QString("scalar_bar_horizontal_height")){
sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_y", sbY1);
sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_height",sbH);
- if(sbY1+sbH > 1.0){
+ if(sbY1+sbH > aTol){
aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
sbY1=0.01;
sbH=0.12;
return myDisplayer;
}
+
+
+void VisuGUI::OnPlot3dFromCutPlane()
+{
+ _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
+ if (CheckLock(aCStudy, GetDesktop(this)))
+ return;
+
+ LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+ SALOME_ListIO aListIO;
+ aSelectionMgr->selectedObjects(aListIO);
+
+ if (aListIO.Extent() < 1) return;
+
+
+ VISU::CutPlanes_i* aCutPrs = 0;
+ Handle(SALOME_InteractiveObject) anIO;
+ _PTR(SObject) aSObject;
+ SALOME_ListIteratorOfListIO It (aListIO);
+ for (; It.More(); It.Next()) {
+ anIO = It.Value();
+
+ if (!anIO.IsNull() && anIO->hasEntry()) {
+ aSObject = aCStudy->FindObjectID(anIO->getEntry());
+ if ( !aSObject )
+ continue;
+ CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this), anIO->getEntry());
+ if (!CORBA::is_nil(anObject)) {
+ VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
+ if (aPrsObject->GetType() == VISU::TCUTPLANES) {
+ aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
+ if (aCutPrs)
+ break;
+ }
+ }
+ }
+ }
+
+ if (aCutPrs) {
+ _PTR(SObject) aTimeStampSObj = aSObject->GetFather();
+ if (SUIT_ViewManager* aViewManager = getApp()->activeViewManager()) {
+ QString aType = aViewManager->getType();
+ bool isVVTK = aType == VVTK_Viewer::Type();
+
+ Storable::TRestoringMap aMap = getMapOfValue(aTimeStampSObj);
+ bool isExist;
+ aType = Storable::FindValue(aMap,"myType",&isExist);
+ if (!isExist || aType.toInt() != TTIMESTAMP )
+ return;
+
+ QString aMeshName = Storable::FindValue(aMap,"myMeshName",&isExist).latin1();
+ QString anEntity = Storable::FindValue(aMap,"myEntityId",&isExist).latin1();
+ QString aFieldName = Storable::FindValue(aMap,"myFieldName",&isExist).latin1();
+ QString aTimeStampId = Storable::FindValue(aMap,"myTimeStampId",&isExist).latin1();
+
+ int aPos;
+ SUIT_ViewWindow* aViewWindow = 0;
+ if (isVVTK) {
+ aViewWindow = GetViewWindow<VVTK_Viewer>(this);
+ aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<VVTK_ViewWindow*>(aViewWindow));
+ } else {
+ aViewWindow = GetViewWindow<SVTK_Viewer>(this);
+ aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<SVTK_ViewWindow*>(GetViewWindow<SVTK_Viewer>(this)));
+ }
+ GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos);
+
+ VISU::Plot3D_i* aPrs3d = CreatePrs3d<VISU::Plot3D_i>(this, aTimeStampSObj, aMeshName.latin1(), (Entity)anEntity.toInt(),
+ aFieldName.latin1(), aTimeStampId.toInt());
+ if (aPrs3d) {
+ SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
+ int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
+ if (!aValue) {
+ VisuGUI_Plot3DDlg* aDlg = new VisuGUI_Plot3DDlg(this);
+ aDlg->initFromPrsObject(aPrs3d);
+ int aOrient = aCutPrs->GetOrientationType(); // Plot3d has the same orientation type
+ double aRotX = aCutPrs->GetRotateX();
+ double aRotY = aCutPrs->GetRotateY();
+ double aPlanePos = aCutPrs->GetPlanePosition(0);
+ aDlg->setPlane(aOrient, aRotX, aRotY, aPlanePos);
+
+ if (!(runAndWait(aDlg, 0) && (aDlg->storeToPrsObject(aPrs3d)))) {
+ DeletePrs3d(this, aPrs3d, anIO);
+ delete aDlg;
+ return;
+ }
+ delete aDlg;
+ UpdateObjBrowser(this, true, aTimeStampSObj);
+ }
+ SVTK_ViewWindow* aSVtkWindow = dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
+ if ( aSVtkWindow ) {
+ PublishInView(this, aPrs3d, aSVtkWindow, /*highlight = */true);
+ aSVtkWindow->onFitAll();
+
+ AddScalarBarPosition(this, aSVtkWindow, aPrs3d, aPos);
+ }
+ }
+ }
+ application()->putInfo(QObject::tr("INF_DONE"));
+ }
+}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
protected slots:
void OnImportFromFile();
- void OnExploreMEDFile();
void OnImportTableFromFile();
void OnExportTableToFile();
void OnImportMedField();
void OnTranslatePrs();
void OnArrangeActors();
+ void OnPlot3dFromCutPlane();
protected:
virtual LightApp_Selection* createSelection() const;
// 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.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef VISUGUI_ACTIONSDEF
#define VISUGUI_ACTIONSDEF
//#define VISU_IMPORT_FROM_FILE 112
-//#define VISU_EXPLORE_MED 113
//#define VISU_IMPORT_MED 114
//#define VISU_IMPORT_TABLE 199
#define VISU_IMPORT_FROM_FILE 4002
-#define VISU_EXPLORE_MED 4003
-#define VISU_IMPORT_TABLE 4004
-#define VISU_IMPORT_MED_STRUCTURE 4005
-#define VISU_IMPORT_MED_TIMESTAMP 4006
-#define VISU_IMPORT_MED_FIELD 4007
+#define VISU_IMPORT_TABLE 4003
+#define VISU_IMPORT_MED_STRUCTURE 4004
+#define VISU_IMPORT_MED_TIMESTAMP 4005
+#define VISU_IMPORT_MED_FIELD 4006
#define VISU_SCALAR_MAP 4011
#define VISU_DEFORMED_SHAPE 4012
#define VISU_FREE_SCALAR_BARS 4081
#define VISU_SHOW_ANIMATION 4082
+#define VISU_PLOT3D_FROM_CUTPLANE 4085
+
#endif
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "VisuGUI_BuildProgressDlg.h"
+#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
#include "SUIT_FileDlg.h"
+#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
#include "SUIT_ResourceMgr.h"
+#include "LightApp_Application.h"
+
#include <vtkTimerLog.h>
#include <qcheckbox.h>
* Constructor
*/
VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ):
- QDialog( theParent, "VisuGUI_BuildProgressBar", false ),
+ QDialog( theParent,
+ "VisuGUI_BuildProgressBar",
+ false,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
myIsRaiseColor( false )
{
setCaption( tr( "DLG_BUILD_PROGRESS_TITLE" ) );
aProgressLayout->setSpacing( 6 );
aProgressLayout->setMargin( 11 );
- myBuildEntitiesCheckBox = new QCheckBox( tr( "BUILD_ENTITIES" ), myProgressBox );
- myBuildEntitiesCheckBox->setChecked( true );
- myBuildEntitiesCheckBox->setEnabled( false );
+ QLabel* aBuildEntitiesLabel = new QLabel( tr( "BUILD_ENTITIES" ), myProgressBox );
myBuildEntitiesButton = new QPushButton( myProgressBox );
myBuildEntitiesButton->setEnabled( false );
myBuildEntitiesButton->setFixedSize( 30, 30 );
myBuildEntitiesButton->setPaletteBackgroundColor( Qt::red );
- connect( myBuildEntitiesCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
myBuildFieldsCheckBox = new QCheckBox( tr( "BUILD_FIELDS" ), myProgressBox );
myBuildFieldsCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "build_fields", true ) );
myBuildGroupsButton->setPaletteBackgroundColor( Qt::red );
connect( myBuildGroupsCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
- aProgressLayout->addWidget( myBuildEntitiesCheckBox, 0, 0 );
+ aProgressLayout->addWidget( aBuildEntitiesLabel, 0, 0 );
aProgressLayout->addWidget( myBuildEntitiesButton, 0, 1 );
aProgressLayout->addWidget( myBuildFieldsCheckBox, 1, 0 );
aProgressLayout->addWidget( myBuildFieldsButton, 1, 1 );
aCloseButton->setAutoDefault( true );
CommonGroupLayout->addWidget( aCloseButton, 0, 2 );
+ QPushButton* aHelpButton = new QPushButton( tr( "HELP" ), CommonGroup );
+ aHelpButton->setAutoDefault( true );
+ CommonGroupLayout->addWidget( aHelpButton, 0, 3 );
+
connect( myStartButton, SIGNAL( clicked() ), this, SLOT( onStart() ) );
connect( aCloseButton, SIGNAL( clicked() ), this, SLOT( onClose() ) );
+ connect( aHelpButton, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
myTimer = new QTimer( this );
connect( myTimer, SIGNAL( timeout() ), this, SLOT( onTimer() ) );
void VisuGUI_BuildProgressDlg::show()
{
- if( onBrowseFile() )
+ if( !myFileName.isNull() || onBrowseFile() )
QWidget::show();
}
if( myFileName.isNull() )
return;
- bool aBuildAll = myBuildAllCheckBox->isChecked();
- bool aBuildAtOnce = myBuildAtOnceCheckBox->isChecked();
-
myResult = myGenerator->CreateResult( myFileName );
- myResult->SetBuildFields( myBuildFieldsCheckBox->isChecked(), myBuildMinMaxCheckBox->isChecked() );
- myResult->SetBuildGroups( myBuildGroupsCheckBox->isChecked() );
-
- //setModal( false );
- myFileNameLineEdit->setReadOnly( true );
- /*
- myBuildAllCheckBox->setNoChange();
- myBuildAtOnceCheckBox->setNoChange();
- myBuildEntitiesCheckBox->setNoChange();
- myBuildFieldsCheckBox->setNoChange();
- myBuildMinMaxCheckBox->setNoChange();
- myBuildGroupsCheckBox->setNoChange();
- */
-
- myStartButton->setEnabled( false );
+ if (CORBA::is_nil(myResult.in())) {
+ SUIT_MessageBox::warn1(this,
+ tr("WRN_VISU"),
+ tr("ERR_ERROR_IN_THE_FILE"),
+ tr("BUT_OK"));
+ onClose();
+ }else{
+ myResult->SetBuildFields( myBuildFieldsCheckBox->isChecked(), myBuildMinMaxCheckBox->isChecked() );
+ myResult->SetBuildGroups( myBuildGroupsCheckBox->isChecked() );
+
+ //setModal( false );
+ myFileNameLineEdit->setReadOnly( true );
+ myStartButton->setEnabled( false );
+
+ bool aBuildAtOnce = myBuildAtOnceCheckBox->isChecked();
+ if( aBuildAtOnce )
+ {
+ QApplication::setOverrideCursor( Qt::waitCursor );
+ myCurrentTime = vtkTimerLog::GetCurrentTime();
+ }
- if( aBuildAtOnce )
- {
- QApplication::setOverrideCursor( Qt::waitCursor );
- myCurrentTime = vtkTimerLog::GetCurrentTime();
+ myTime.setHMS( 0, 0, 0 );
+ myTimer->start( 100 );
+
+ bool aBuildAll = myBuildAllCheckBox->isChecked();
+ myResult->Build( aBuildAll, aBuildAtOnce );
}
-
- myTime.setHMS( 0, 0, 0 );
- myTimer->start( 100 );
-
- myResult->Build( aBuildAll, aBuildAtOnce );
}
void VisuGUI_BuildProgressDlg::onClose()
done( 0 );
}
+void VisuGUI_BuildProgressDlg::onHelp()
+{
+ QString aHelpFileName = "/files/importing_med_objects.htm"; // ?
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+ app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ }
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
+
bool VisuGUI_BuildProgressDlg::onBrowseFile()
{
QString aRootDir = QString( getenv( "VISU_ROOT_DIR") );
myBuildGroupsButton->setPaletteBackgroundColor( aColor );
}
+
+void VisuGUI_BuildProgressDlg::setFileName( const QString& theFileName )
+{
+ if ( !theFileName.isNull() )
+ {
+ myFileName = theFileName;
+ myFileNameLineEdit->setText( myFileName.section( '/', -1 ) );
+ }
+}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
virtual void show();
QString fileName() const { return myFileName; }
+ void setFileName( const QString& theFileName );
protected slots:
void done( int );
void onStart();
void onClose();
+ void onHelp();
bool onBrowseFile();
void onTimer();
QGroupBox* myProgressBox;
- QCheckBox* myBuildEntitiesCheckBox;
QPushButton* myBuildEntitiesButton;
QCheckBox* myBuildFieldsCheckBox;
// 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.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "VisuGUI_ClippingDlg.h"
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
#include "VISU_Prs3d_i.hh"
#include "VISU_Result_i.hh"
#include "VISU_PipeLine.hxx"
#include "LightApp_SelectionMgr.h"
+#include "LightApp_Application.h"
#include "SVTK_ViewWindow.h"
//class : OrientedPlane
//purpose :
//=================================================================================
-class OrientedPlane: public vtkPlane
+OrientedPlane* OrientedPlane::New()
{
- SVTK_ViewWindow* myViewWindow;
-
- vtkDataSetMapper* myMapper;
-
-public:
- static OrientedPlane * New() {
- return new OrientedPlane();
- }
- static OrientedPlane * New (SVTK_ViewWindow* vw) {
- return new OrientedPlane(vw);
- }
- vtkTypeMacro(OrientedPlane, vtkPlane);
-
-
- VISU::Orientation myOrientation;
- float myDistance;
- double myAngle[2];
-
- vtkPlaneSource* myPlaneSource;
- SALOME_Actor *myActor;
-
- void SetOrientation(VISU::Orientation theOrientation) {myOrientation = theOrientation;}
- VISU::Orientation GetOrientation() {return myOrientation;}
-
- void SetDistance(float theDistance) {myDistance = theDistance;}
- float GetDistance() {return myDistance;}
-
- void ShallowCopy(OrientedPlane* theOrientedPlane){
- SetNormal(theOrientedPlane->GetNormal());
- SetOrigin(theOrientedPlane->GetOrigin());
-
- myOrientation = theOrientedPlane->GetOrientation();
- myDistance = theOrientedPlane->GetDistance();
-
- myAngle[0] = theOrientedPlane->myAngle[0];
- myAngle[1] = theOrientedPlane->myAngle[1];
-
- myPlaneSource->SetNormal(theOrientedPlane->myPlaneSource->GetNormal());
- myPlaneSource->SetOrigin(theOrientedPlane->myPlaneSource->GetOrigin());
- myPlaneSource->SetPoint1(theOrientedPlane->myPlaneSource->GetPoint1());
- myPlaneSource->SetPoint2(theOrientedPlane->myPlaneSource->GetPoint2());
- }
-
-protected:
- OrientedPlane(SVTK_ViewWindow* vw):
- myOrientation(VISU::XY),
- myDistance(0.5),
- myViewWindow(vw)
- {
- Init();
- myViewWindow->AddActor(myActor);
- }
-
- OrientedPlane():
- myOrientation(VISU::XY),
- myDistance(0.5),
- myViewWindow(NULL)
- {
- Init();
- }
+ return new OrientedPlane();
+}
- void Init(){
- myPlaneSource = vtkPlaneSource::New();
+OrientedPlane* OrientedPlane::New (SVTK_ViewWindow* vw)
+{
+ return new OrientedPlane(vw);
+}
- myAngle[0] = myAngle[1] = 0.0;
+void OrientedPlane::SetOrientation(VISU::Orientation theOrientation)
+{
+ myOrientation = theOrientation;
+}
- // Create and display actor
- myMapper = vtkDataSetMapper::New();
- myMapper->SetInput(myPlaneSource->GetOutput());
+VISU::Orientation OrientedPlane::GetOrientation()
+{
+ return myOrientation;
+}
- myActor = SALOME_Actor::New();
- myActor->VisibilityOff();
- myActor->PickableOff();
- myActor->SetInfinitive(true);
- myActor->SetMapper(myMapper);
+void OrientedPlane::SetDistance(float theDistance)
+{
+ myDistance = theDistance;
+}
- vtkProperty* aProp = vtkProperty::New();
- float anRGB[3];
+float OrientedPlane::GetDistance()
+{
+ return myDistance;
+}
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+void OrientedPlane::ShallowCopy(OrientedPlane* theOrientedPlane)
+{
+ SetNormal(theOrientedPlane->GetNormal());
+ SetOrigin(theOrientedPlane->GetOrigin());
+
+ myOrientation = theOrientedPlane->GetOrientation();
+ myDistance = theOrientedPlane->GetDistance();
+
+ myAngle[0] = theOrientedPlane->myAngle[0];
+ myAngle[1] = theOrientedPlane->myAngle[1];
+
+ myPlaneSource->SetNormal(theOrientedPlane->myPlaneSource->GetNormal());
+ myPlaneSource->SetOrigin(theOrientedPlane->myPlaneSource->GetOrigin());
+ myPlaneSource->SetPoint1(theOrientedPlane->myPlaneSource->GetPoint1());
+ myPlaneSource->SetPoint2(theOrientedPlane->myPlaneSource->GetPoint2());
+}
- QColor aFillColor = aResourceMgr->colorValue("SMESH", "fill_color", QColor(0, 170, 255));
- anRGB[0] = aFillColor.red()/255.;
- anRGB[1] = aFillColor.green()/255.;
- anRGB[2] = aFillColor.blue()/255.;
- aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
- aProp->SetOpacity(0.75);
- myActor->SetProperty(aProp);
- aProp->Delete();
-
- vtkProperty* aBackProp = vtkProperty::New();
- QColor aBackFaceColor = aResourceMgr->colorValue("SMESH", "backface_color", QColor(0, 0, 255));//@
- anRGB[0] = aBackFaceColor.red()/255.;
- anRGB[1] = aBackFaceColor.green()/255.;
- anRGB[2] = aBackFaceColor.blue()/255.;
- aBackProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
- aBackProp->SetOpacity(0.75);
- myActor->SetBackfaceProperty(aBackProp);
- aBackProp->Delete();
- }
+OrientedPlane::OrientedPlane(SVTK_ViewWindow* vw):
+ myOrientation(VISU::XY),
+ myDistance(0.5),
+ myViewWindow(vw)
+{
+ Init();
+ myViewWindow->AddActor(myActor);
+}
- ~OrientedPlane()
- {
- if (myViewWindow)
- myViewWindow->RemoveActor(myActor);
+OrientedPlane::OrientedPlane():
+ myOrientation(VISU::XY),
+ myDistance(0.5),
+ myViewWindow(NULL)
+{
+ Init();
+}
- myActor->Delete();
+void OrientedPlane::Init()
+{
+ myPlaneSource = vtkPlaneSource::New();
+
+ myAngle[0] = myAngle[1] = 0.0;
+
+ // Create and display actor
+ myMapper = vtkDataSetMapper::New();
+ myMapper->SetInput(myPlaneSource->GetOutput());
+
+ myActor = SALOME_Actor::New();
+ myActor->VisibilityOff();
+ myActor->PickableOff();
+ myActor->SetInfinitive(true);
+ myActor->SetMapper(myMapper);
+
+ vtkProperty* aProp = vtkProperty::New();
+ float anRGB[3];
+
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+
+ QColor aFillColor = aResourceMgr->colorValue("SMESH", "fill_color", QColor(0, 170, 255));
+ anRGB[0] = aFillColor.red()/255.;
+ anRGB[1] = aFillColor.green()/255.;
+ anRGB[2] = aFillColor.blue()/255.;
+ aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ aProp->SetOpacity(0.75);
+ myActor->SetProperty(aProp);
+ aProp->Delete();
+
+ vtkProperty* aBackProp = vtkProperty::New();
+ QColor aBackFaceColor = aResourceMgr->colorValue("SMESH", "backface_color", QColor(0, 0, 255));//@
+ anRGB[0] = aBackFaceColor.red()/255.;
+ anRGB[1] = aBackFaceColor.green()/255.;
+ anRGB[2] = aBackFaceColor.blue()/255.;
+ aBackProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ aBackProp->SetOpacity(0.75);
+ myActor->SetBackfaceProperty(aBackProp);
+ aBackProp->Delete();
+}
- myMapper->RemoveAllInputs();
- myMapper->Delete();
+OrientedPlane::~OrientedPlane()
+{
+ if (myViewWindow)
+ myViewWindow->RemoveActor(myActor);
- myPlaneSource->UnRegisterAllOutputs();
- myPlaneSource->Delete();
- };
+ myActor->Delete();
-private:
- // Not implemented.
- OrientedPlane(const OrientedPlane&);
- void operator=(const OrientedPlane&);
-};
+ myMapper->RemoveAllInputs();
+ myMapper->Delete();
+
+ myPlaneSource->UnRegisterAllOutputs();
+ myPlaneSource->Delete();
+}
struct TSetVisiblity {
TSetVisiblity(int theIsVisible): myIsVisible(theIsVisible){}
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
+ buttonHelp = new QPushButton (GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("BUT_HELP"));
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
buttonCancel = new QPushButton (GroupButtons, "buttonCancel");
buttonCancel->setText(tr("BUT_CLOSE"));
buttonCancel->setAutoDefault(TRUE);
connect(buttonOk , SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply , SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonHelp , SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged()));
{
// no need to delete child widgets, Qt does it all for us
std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
- VISU::RenderViewWindow(VISU::GetViewWindow(myVisuGUI));
+ VISU::RenderViewWindow(VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI));
}
//=================================================================================
if (!myPrs3d)
return;
- if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI)) {
+ if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI)) {
SUIT_OverrideCursor wc;
+ QWidget *aCurrWid = this->focusWidget();
+ aCurrWid->clearFocus();
+ aCurrWid->setFocus();
+
// Save clipping planes, currently applied to the presentation
// to enable restoring this state in case of failure.
// Refer to bugs IPAL8849, IPAL8850 for more information.
close();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void VisuGUI_ClippingDlg::ClickOnHelp()
+{
+ QString aHelpFileName = "clipping.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
+
//=================================================================================
// function : onSelectionChanged()
// purpose : Called when selection is changed
//=================================================================================
void VisuGUI_ClippingDlg::onSelectionChanged()
{
- if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI)) {
+ if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI)) {
Handle(SALOME_InteractiveObject) anIO;
CORBA::Object_var anObject = VISU::GetSelectedObj(myVisuGUI, &anIO);
myIO = anIO;
std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
myPlanes.clear();
- float anOffset [3];
- myPrs3d->GetOffset(anOffset);
+ CORBA::Float anOffset[3];
+ myPrs3d->GetOffset(anOffset[0],anOffset[1],anOffset[2]);
vtkIdType anId = 0, anEnd = myPrs3d->GetNumberOfClippingPlanes();
for (; anId < anEnd; anId++) {
VISU::TVTKPlane aTVTKPlane(anOrientedPlane);
anOrientedPlane->Delete();
aTVTKPlane->ShallowCopy(aPlane);
- aTVTKPlane->myActor->SetPosition(anOffset);
+ aTVTKPlane->myActor->SetPosition(anOffset[0],anOffset[1],anOffset[2]);
myPlanes.push_back(aTVTKPlane);
}
}
//=================================================================================
void VisuGUI_ClippingDlg::ClickOnNew()
{
+ if(!AutoApplyCheckBox->isChecked())
+ ClickOnApply();
+
if (!myPrs3d)
return;
- if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI)) {
+ if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI)) {
OrientedPlane* aPlane = OrientedPlane::New(aViewWindow);
VISU::TVTKPlane aTVTKPlane(aPlane);
myPlanes.push_back(aTVTKPlane);
- float anOffset [3];
- myPrs3d->GetOffset(anOffset);
- aTVTKPlane->myActor->SetPosition(anOffset);
+ CORBA::Float anOffset[3];
+ myPrs3d->GetOffset(anOffset[0],anOffset[1],anOffset[2]);
+ aTVTKPlane->myActor->SetPosition(anOffset[0],anOffset[1],anOffset[2]);
if (PreviewCheckBox->isChecked())
aTVTKPlane->myActor->VisibilityOn();
ClickOnApply();
Sinchronize();
- if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI))
+ if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI))
VISU::RenderViewWindow(aViewWindow);
}
OrientedPlane* aPlane = myPlanes[aCurPlaneIndex].GetPointer();
- float aNormal[3];
+ vtkFloatingPointType aNormal[3];
VISU::Orientation anOrientation;
- float aDir[3][3] = {{0, 0, 0}, {0, 0, 0}};
+ vtkFloatingPointType aDir[3][3] = {{0, 0, 0}, {0, 0, 0}};
{
static double aCoeff = vtkMath::Pi()/180.0;
- float aRot[2] = {getRotation1(), getRotation2()};
+ vtkFloatingPointType aRot[2] = {getRotation1(), getRotation2()};
aPlane->myAngle[0] = aRot[0];
aPlane->myAngle[1] = aRot[1];
- float anU[2] = {cos(aCoeff*aRot[0]), cos(aCoeff*aRot[1])};
- float aV[2] = {sqrt(1.0-anU[0]*anU[0]), sqrt(1.0-anU[1]*anU[1])};
+ vtkFloatingPointType anU[2] = {cos(aCoeff*aRot[0]), cos(aCoeff*aRot[1])};
+ vtkFloatingPointType aV[2] = {sqrt(1.0-anU[0]*anU[0]), sqrt(1.0-anU[1]*anU[1])};
aV[0] = aRot[0] > 0? aV[0]: -aV[0];
aV[1] = aRot[1] > 0? aV[1]: -aV[1];
myPrs3d->SetPlaneParam(aNormal, 1. - getDistance(), aPlane);
vtkDataSet* aDataSet = myPrs3d->GetInput();
- float *aPnt = aDataSet->GetCenter();
+ vtkFloatingPointType *aPnt = aDataSet->GetCenter();
- float* anOrigin = aPlane->GetOrigin();
- float aDel = aDataSet->GetLength()/2.0;
+ vtkFloatingPointType* anOrigin = aPlane->GetOrigin();
+ vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
- float aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel},
- {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
- float aParam, aPnt0[3], aPnt1[3], aPnt2[3];
+ vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel},
+ {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
+ vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3];
- float aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
- aPnt[1] - aDelta[0][1] - aDelta[1][1],
- aPnt[2] - aDelta[0][2] - aDelta[1][2]};
- float aPnt02[3] = {aPnt01[0] + aNormal[0],
- aPnt01[1] + aNormal[1],
- aPnt01[2] + aNormal[2]};
+ vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
+ aPnt[1] - aDelta[0][1] - aDelta[1][1],
+ aPnt[2] - aDelta[0][2] - aDelta[1][2]};
+ vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0],
+ aPnt01[1] + aNormal[1],
+ aPnt01[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0);
- float aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
- aPnt[1] - aDelta[0][1] + aDelta[1][1],
- aPnt[2] - aDelta[0][2] + aDelta[1][2]};
- float aPnt12[3] = {aPnt11[0] + aNormal[0],
- aPnt11[1] + aNormal[1],
- aPnt11[2] + aNormal[2]};
+ vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
+ aPnt[1] - aDelta[0][1] + aDelta[1][1],
+ aPnt[2] - aDelta[0][2] + aDelta[1][2]};
+ vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0],
+ aPnt11[1] + aNormal[1],
+ aPnt11[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1);
- float aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
- aPnt[1] + aDelta[0][1] - aDelta[1][1],
- aPnt[2] + aDelta[0][2] - aDelta[1][2]};
- float aPnt22[3] = {aPnt21[0] + aNormal[0],
- aPnt21[1] + aNormal[1],
- aPnt21[2] + aNormal[2]};
+ vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
+ aPnt[1] + aDelta[0][1] - aDelta[1][1],
+ aPnt[2] + aDelta[0][2] - aDelta[1][2]};
+ vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0],
+ aPnt21[1] + aNormal[1],
+ aPnt21[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2);
vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource;
if (AutoApplyCheckBox->isChecked())
ClickOnApply();
- if (SVTK_ViewWindow* vw = VISU::GetViewWindow(myVisuGUI))
+ if (SVTK_ViewWindow* vw = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI))
VISU::RenderViewWindow(vw);
}
int i, axId = ButtonGroupIJKAxis->id (ButtonGroupIJKAxis->selected());
VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axId;
gp_Dir dir;
- const vector<float> * values =
+ const vector<vtkFloatingPointType> * values =
result->GetAxisInfo(myPrs3d->GetMeshName(), axis, dir);
if (!values)
return;
// find distance;
int index = SpinBoxIJKIndex->value();
- float distance = 0;
+ vtkFloatingPointType distance = 0;
if (index < values->size())
distance = (*values)[ index ];
}
}
// find rotation angles
- float angle[2];
+ vtkFloatingPointType angle[2];
int rotId[2] = {
(axId == 0) ? 2 : axId - 1,
(axId == 2) ? 0 : axId + 1
};
static double aCoeff = 180.0/vtkMath::Pi();
for (i = 0; i < 2; ++i) {
- float cosin = cos[ rotId[ i ]];
+ vtkFloatingPointType cosin = cos[ rotId[ i ]];
if (maxCos < 0)
cosin = -cosin;
angle[ i ] = asin(cosin) * aCoeff;
int planeIndex = ComboBoxPlanes->currentItem();
OrientedPlane* plane = myPlanes[ planeIndex ].GetPointer();
vtkPlaneSource* planeSource = plane->myPlaneSource;
- float * planeNormal = planeSource->GetNormal();
+ vtkFloatingPointType * planeNormal = planeSource->GetNormal();
gp_Dir normal(planeNormal[0], planeNormal[1], planeNormal[2]);
// find a grid axis most co-directed with plane normal
int i, maxAx = 0, gridAxId = 0;
gp_Dir dir, gridDir;
double maxDot = 0;
- const vector<float> *curValues, *values = 0;
+ const vector<vtkFloatingPointType> *curValues, *values = 0;
VISU::Result_i* result = myPrs3d->GetResult();
for (i = 0; i < 3; ++i) {
VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) i;
if (result) {
VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axisId;
gp_Dir dir;
- const vector<float> * indices = result->GetAxisInfo(myPrs3d->GetMeshName(),
- axis, dir);
+ const vector<vtkFloatingPointType> * indices = result->GetAxisInfo(myPrs3d->GetMeshName(),
+ axis, dir);
if (indices)
maxIndex = indices->size() - 1;
}
void VisuGUI_ClippingDlg::OnPreviewToggle (bool theIsToggled)
{
std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(theIsToggled));
- if (SVTK_ViewWindow* vw = VISU::GetViewWindow(myVisuGUI))
+ if (SVTK_ViewWindow* vw = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI))
VISU::RenderViewWindow(vw);
}
// 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.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef DIALOGBOX_CLIPPING_H
class QSpinBox;
class QTabWidget;
+class SALOME_Actor;
+
class QtxDblSpinBox;
+class SVTK_ViewWindow;
+
class LightApp_SelectionMgr;
class VisuGUI;
+class vtkPlaneSource;
+class vtkDataSetMapper;
+
class OrientedPlane;
namespace VISU {
enum Orientation {XY, YZ, ZX};
};
+//=================================================================================
+//class : OrientedPlane
+//purpose :
+//=================================================================================
+class OrientedPlane: public vtkPlane
+{
+ SVTK_ViewWindow* myViewWindow;
+ vtkDataSetMapper* myMapper;
+
+public:
+ static OrientedPlane* New();
+ static OrientedPlane* New (SVTK_ViewWindow* vw);
+
+ vtkTypeMacro(OrientedPlane, vtkPlane);
+
+ VISU::Orientation myOrientation;
+ float myDistance;
+ double myAngle[2];
+
+ vtkPlaneSource* myPlaneSource;
+ SALOME_Actor* myActor;
+
+ void SetOrientation(VISU::Orientation theOrientation);
+ VISU::Orientation GetOrientation();
+
+ void SetDistance(float theDistance);
+ float GetDistance();
+
+ void ShallowCopy(OrientedPlane* theOrientedPlane);
+
+protected:
+ OrientedPlane();
+ OrientedPlane(SVTK_ViewWindow* vw);
+ ~OrientedPlane();
+
+ void Init();
+
+private:
+ OrientedPlane(const OrientedPlane&);
+ void operator=(const OrientedPlane&);
+};
//=================================================================================
// class : VisuGUI_ClippingDlg
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
+ QPushButton* buttonHelp;
bool myIsSelectPlane;
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
+ void ClickOnHelp();
};
#endif // DIALOGBOX_TRANSPARENCYDLG_H
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include <string>
using namespace std;
+
+#include "VisuGUI.h"
#include "VisuGUI_CursorDlg.h"
+
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
+
+#include "LightApp_Application.h"
+
#include <qlayout.h>
/*!
buttonCancel->setAutoDefault(TRUE);
GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
+ buttonHelp = new QPushButton(tr("&Help") , GroupButtons, "buttonHelp");
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
+
TopLayout->addWidget(TopGroupBox, 0, 0);
TopLayout->addWidget(GroupButtons, 1, 0);
// signals and slots connections
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
}
/*!
VisuGUI_CursorDlg::~VisuGUI_CursorDlg()
{
}
+
+/*!
+ function : onHelp()
+ purpose :
+*/
+void VisuGUI_CursorDlg::onHelp()
+{
+ QString aHelpFileName = "/files/changing_visualization_parameters_of_the_presenetation.htm#Width";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+ app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ }
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
QGroupBox* GroupButtons;
QPushButton* buttonOk;
QPushButton* buttonCancel;
+ QPushButton* buttonHelp;
+
+private slots:
+ void onHelp();
+
};
#endif // VISUGUI_CURSORDLG_H
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VisuGUI_CutLinesDlg.cxx
// Author : VSV
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
#include "VISU_Gen_i.hh"
#include "VISU_CutLines_i.hh"
#include "SVTK_ViewWindow.h"
-#include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
#include "SalomeApp_Study.h"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
#include "OB_Browser.h"
QHBox* aPosBox = new QHBox (aPlanePane);
aPosBox->setSpacing(5);
- QLabel* aPosLbl = new QLabel (tr("LBL_POS"), aPosBox);
+ new QLabel (tr("LBL_POS"), aPosBox);
myPosSpn = new QtxDblSpinBox (0, 1, 0.1, aPosBox);
myPosSpn->setValue(0.5);
aPlaneLayout->addWidget(aPosBox);
QHBox* aNbBox = new QHBox(aLinesPane);
aNbBox->setSpacing(5);
- QLabel* aNbLbl = new QLabel( tr( "LBL_NB_PLANS" ), aNbBox );
+ new QLabel( tr( "LBL_NB_PLANS" ), aNbBox );
myNbSpn = new QtxDblSpinBox( 1, 100, 1, aNbBox );
myNbSpn->setValue( 10 );
QHBox* aPosBox2 = new QHBox(aLinesPane);
aPosBox2->setSpacing(5);
- QLabel* aPosLbl2 = new QLabel( tr( "LBL_POS" ), aPosBox2 );
+ new QLabel( tr( "LBL_POS" ), aPosBox2 );
myPosSpn2 = new QtxDblSpinBox( 0, 1, 0.1, aPosBox2 );
myPosSpn2->setValue( 0.5 );
aLinesLayout->addWidget( aPosBox2 );
QPushButton* aCloseBtn = new QPushButton(tr("BUT_CANCEL"), aBtnBox);
aBtnLayout->addWidget(aCloseBtn);
+ QPushButton* aHelpBtn = new QPushButton(tr("BUT_HELP"), aBtnBox);
+ aBtnLayout->addWidget(aHelpBtn);
+
aMainLayout->addWidget(aBtnBox);
myCutLines = NULL;
connect(aOkBtn, SIGNAL(clicked()), this, SLOT(accept()));
connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
//connect(myMgr, SIGNAL(closeAllViews()), this, SLOT(reject()));
//connect(VisuGUI::application()->desktop(),
// SIGNAL(windowActivated(SUIT_ViewWindow*)),
deletePlanes();
if (myCutLines) //delete myCutLines;
myCutLines->Destroy();
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
vf->Repaint();
}
//------------------------------------------------------------------------------
void VisuGUI_CutLinesDlg::createPlanes()
{
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView == NULL) return;
if (myCutLines == NULL) return;
if (myPreviewActor != 0) return;
aPlaneMapper->SetInput(aPolyData->GetOutput());
aPlaneMapper->ScalarVisibilityOff();
- myPreviewActorGlyphs = myPreviewActorGlyphs = SALOME_Actor::New();
+ myPreviewActorGlyphs = SALOME_Actor::New();
myPreviewActorGlyphs->PickableOff();
updateGlyphs(false);
void VisuGUI_CutLinesDlg::deletePlanes()
{
if (myPreviewActor == 0) return;
- if (SVTK_ViewWindow* aView = VISU::GetViewWindow()){
- aView->RemoveActor(myPreviewActor);
- aView->RemoveActor(myPreviewActorGlyphs);
- }
+ SVTK_ViewWindow* aView;
+ vtkRenderer* aRend = myPreviewActor->GetRenderer();
+ vtkRenderer* aRendGlyphs = myPreviewActorGlyphs->GetRenderer();
+
+ vtkRenderWindow* aWnd1 = aRend->GetRenderWindow();
+ vtkRenderWindow* aWnd2 = aRendGlyphs->GetRenderWindow();
+ if(aRend && aWnd1)
+ myPreviewActor->RemoveFromRender(aRend);
+ if(aRendGlyphs && aWnd2)
+ myPreviewActorGlyphs->RemoveFromRender(aRendGlyphs);
+
+// Bug IPAL11962: preview is still in the viewer, if viewer not active.
+// if (aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>()){
+// aView->RemoveActor(myPreviewActor);
+// aView->RemoveActor(myPreviewActorGlyphs);
+// }
+
myPreviewActor->Delete();
myPreviewActorGlyphs->Delete();
myPreviewActor = 0;
myRotXLbl2->setText( tr("LBL_ROT_Z"));
myRotYLbl2->setText( tr("LBL_ROT_X"));
}
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
/*myCutLines->SetOrientation2(getOrientaion(false),
/* float aPos = myCutLines->GetBasePlanePosition();
myBasePlanePos->setText( QString::number(aPos) );
myBasePlanePos->setEnabled(false);*/
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
//myCutLines->SetBasePlanePosition(aPos);
//aView->Repaint();
}
}
- float aPos = myCutLines->GetBasePlanePosition();
+ vtkFloatingPointType aPos = myCutLines->GetBasePlanePosition();
myBasePlanePos->setText( QString::number(aPos) );
myBasePlanePos->setEnabled(false);
} else {
vh->setLabel( i, str.arg(i+1) );
}
// Update preview
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (myPreviewCheck->isChecked()) {
// myCutLines->GetPL()->Update();
void VisuGUI_CutLinesDlg::updateGlyphs(bool update){
if (myPreviewActorGlyphs == 0 ) return;
- const float *aDirLn = myCutLines->GetCutLinesPL()->GetDirLn();
- const float *aBasePnt = myCutLines->GetCutLinesPL()->GetBasePnt();
- float aSecondPnt[3];
- float aBoundCenter[3];
+ const vtkFloatingPointType *aDirLn = myCutLines->GetCutLinesPL()->GetRealDirLn();
+ const vtkFloatingPointType *aBasePnt = myCutLines->GetCutLinesPL()->GetBasePnt();
+ vtkFloatingPointType aSecondPnt[3];
+ vtkFloatingPointType aBoundCenter[3];
vtkAppendPolyData* aPolyData = myCutLines->GetCutLinesPL()->GetAppendPolyData();
vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
aPlaneMapper->SetInput(aPolyData->GetOutput());
- float bounds[6];
+ vtkFloatingPointType bounds[6];
aPlaneMapper->GetBounds(bounds);
for(int i=0; i<3; i++) aBoundCenter[i] = (bounds[i*2] + bounds[i*2+1])/2.0;
for(int i=0; i<3; i++){
if (!myAllCurvesInvertedCheck->isChecked())
- aSecondPnt[i] = aBasePnt[i] + aDirLn[i];
+ aSecondPnt[i] = aDirLn[i];
else
- aSecondPnt[i] = -aBasePnt[i] - aDirLn[i];
+ aSecondPnt[i] = - aDirLn[i];
}
- float max_bound = 0;
+ vtkFloatingPointType max_bound = 0;
max_bound < bounds[1]-bounds[0] ? max_bound = bounds[1] - bounds[0] : max_bound = max_bound;
max_bound < bounds[3]-bounds[2] ? max_bound = bounds[3] - bounds[2] : max_bound = max_bound;
max_bound < bounds[5]-bounds[4] ? max_bound = bounds[5] - bounds[4] : max_bound = max_bound;
vtkGlyphSource2D* source = vtkGlyphSource2D::New();
source->FilledOn();
- source->SetCenter(aBoundCenter);
source->SetGlyphTypeToArrow();
- aPoints->InsertNextPoint(aBasePnt);
+ aPoints->InsertNextPoint(aBoundCenter);
profile->SetPoints(aPoints);
aFloatArray->SetNumberOfComponents(3);
source->Delete();
aPlaneMapper->Delete();
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
if (update)
vf->Repaint();
}
QString aTxt = myPosTable->text(theRow, 0);
bool isChanged = !aTxt.isEmpty();
((QCheckTableItem*)myPosTable->item(theRow, 1))->setChecked(!isChanged);
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (myPreviewCheck->isChecked()) {
//Update Preview
if (isDefault) {
//myCutLines->SetDefaultPosition(theRow);
// myPosTable->setText(theRow, 0, QString::number(myCutLines->GetLinePosition(theRow)));
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (myPreviewCheck->isChecked()) {
//Update Preview
void VisuGUI_CutLinesDlg::onPreviewCheck (bool thePreview)
{
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
if (thePreview) {
//storeToPrsObject(myCutLines);
// myCutLines->GetPL()->Update();
void VisuGUI_CutLinesDlg::onRotation (double theValue)
{
if (myCutLines == NULL) return;
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (myPreviewCheck->isChecked()) {
void VisuGUI_CutLinesDlg::onPlanePos (const QString& theValue)
{
if (myCutLines == NULL) return;
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (myPreviewCheck->isChecked()) {
//myCutLines->SetBasePlanePosition(theValue.toDouble());
}
}
+void VisuGUI_CutLinesDlg::onHelp()
+{
+ QString aHelpFileName = "/files/cut_lines_presentation.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+ app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ }
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
+
//jfa tmp:void VisuGUI_CutLinesDlg::onWindowActivated (SUIT_ViewWindow* theWnd)
//jfa tmp:{
//jfa tmp: if (theWnd != myStudyWnd)
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VisuGUI_CutLinesDlg.h
// Author : VSV
void onAllCurvesInvertedCheck(bool theInvert);
void onRotation (double theValue);
void onPlanePos (const QString& theValue);
+ void onHelp();
//jfa tmp:void onWindowActivated (SUIT_ViewWindow*);
private:
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
#include "VISU_CutPlanes_i.hh"
#include "VISU_CutPlanesPL.hxx"
#include "SVTK_ViewWindow.h"
-#include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
#include "SUIT_Application.h"
#include "SUIT_Desktop.h"
#include "SUIT_ViewWindow.h"
#include "SUIT_ViewManager.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
#include <qlayout.h>
#include <qcheckbox.h>
VisuGUI_CutPlanesPane::~VisuGUI_CutPlanesPane()
{
- cout<<"### VisuGUI_CutPlanesPane::~VisuGUI_CutPlanesPane"<<endl;
deletePlanes();
if (myCutPlanes)
myCutPlanes->Destroy();
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
vf->Repaint();
}
void VisuGUI_CutPlanesPane::createPlanes()
{
- if (VISU::GetViewWindow() == NULL) return;
+ if (VISU::GetActiveViewWindow<SVTK_ViewWindow>() == NULL) return;
if (myCutPlanes == NULL) return;
if (myPreviewActor != 0) return;
myPreviewActor->PickableOff();
myPreviewActor->SetMapper(aPlaneMapper);
aPlaneMapper->Delete();
- VISU::GetViewWindow()->AddActor(myPreviewActor);
+ VISU::GetActiveViewWindow<SVTK_ViewWindow>()->AddActor(myPreviewActor);
}
int VisuGUI_CutPlanesPane::storeToPrsObject (VISU::CutPlanes_i* thePrs)
// Update preview
if (myPreviewCheck->isChecked()) {
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
myCutPlanes->GetPL()->Update();
deletePlanes();
createPlanes();
if (myPreviewCheck->isChecked()) {
//Update Preview
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
myCutPlanes->SetPlanePosition( theRow, aTxt.toDouble());
myCutPlanes->GetPL()->Update();
deletePlanes();
myPosTable->setText(theRow, 0, QString::number(myCutPlanes->GetPlanePosition(theRow)));
if (myPreviewCheck->isChecked()) {
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
//Update Preview
myCutPlanes->GetPL()->Update();
deletePlanes();
void VisuGUI_CutPlanesPane::deletePlanes()
{
if (myPreviewActor == 0) return;
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
- vf->RemoveActor(myPreviewActor);
+ vtkRenderer* aRend = myPreviewActor->GetRenderer();
+ if(aRend)
+ myPreviewActor->RemoveFromRender(aRend);
+// Bug IPAL11962: preview is still in the viewer, if viewer not active.
+// if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
+// vf->RemoveActor(myPreviewActor);
myPreviewActor->Delete();
myPreviewActor = 0;
}
{
if (myCutPlanes == NULL) return;
if (myPreviewCheck->isChecked()) {
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.);
myCutPlanes->GetPL()->Update();
deletePlanes();
void VisuGUI_CutPlanesPane::onPreviewCheck (bool thePreview)
{
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
if (thePreview) {
storeToPrsObject(myCutPlanes);
myCutPlanes->GetPL()->Update();
buttonCancel->setAutoDefault(TRUE);
GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
+ QPushButton* buttonHelp = new QPushButton(tr("&Help"), GroupButtons, "buttonHelp");
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
+
TopLayout->addWidget(GroupButtons);
connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
//connect(myMgr, SIGNAL(closeAllViews()), this, SLOT(reject()));
//connect(VisuGUI::application()->desktop(),
// SIGNAL(windowActivated(SUIT_ViewWindow*)),
QDialog::reject();
}
+void VisuGUI_CutPlanesDlg::onHelp()
+{
+ QString aHelpFileName = "/files/cut_lines_resentation.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+ app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ }
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
+
//void VisuGUI_CutPlanesDlg::onWindowActivated (SUIT_ViewWindow* theWnd)
//{
// if (theWnd != myStudyWnd)
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
SALOME_Actor* myPreviewActor;
private slots:
- //void editScalarBar();
+//VSR: 08/06/06: void editScalarBar();
void orientationChanged( int );
void DrawTable();
void setDefault( int all = -1);
protected slots:
void accept();
void reject();
- //void onWindowActivated (SUIT_ViewWindow*);
+//VSR: 08/06/06: void onWindowActivated (SUIT_ViewWindow*);
+ void onHelp();
private:
VisuGUI_CutPlanesPane* myCutPane;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "VisuGUI_DeformedShapeDlg.h"
+#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
#include "VISU_DeformedShape_i.hh"
#include "SalomeApp_Module.h"
+#include "LightApp_Application.h"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
#include <qlayout.h>
#include <qtabwidget.h>
buttonCancel->setAutoDefault(TRUE);
GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
+ QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp");
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
+
// Add Tab box and Buttons to the top layout
TopLayout->addWidget(aTabBox);
TopLayout->addWidget(GroupButtons);
// signals and slots connections
connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
}
void VisuGUI_DeformedShapeDlg::initFromPrsObject (VISU::DeformedShape_i* thePrs)
myScalarPane->deletePreview();
QDialog::reject();
}
+
+void VisuGUI_DeformedShapeDlg::onHelp()
+{
+ QString aHelpFileName = "/files/deformed_shape_presentation.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+ app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ }
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
protected slots:
void accept();
void reject();
+ void onHelp();
private:
QtxDblSpinBox* ScalFact;
// 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.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: VisuGUI_DialogRunner.cxx
// Created: Thu Oct 6 10:17:39 2005
// 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.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// $Header: /home/server/cvs/VISU/VISU_SRC/src/VISUGUI/VisuGUI_Displayer.cxx
#include "VisuGUI_Displayer.h"
-#include "VVTK_ViewModel.h"
+
#include "VisuGUI_Tools.h"
+#include "VISU_ViewManager_i.hh"
#include "VISU_Actor.h"
+#include "VVTK_ViewModel.h"
+
#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
-#include "VISU_ViewManager_i.hh"
+#include <SUIT_MessageBox.h>
VisuGUI_Displayer::VisuGUI_Displayer( SalomeApp_Application* app )
: LightApp_Displayer(),
if( CORBA::is_nil( anObj ) )
return 0;
- SVTK_Viewer* vtk_viewer = dynamic_cast<SVTK_Viewer*>( aViewFrame );
+ SVTK_Viewer* vtk_viewer = dynamic_cast<VVTK_Viewer*>( aViewFrame );
+ if (!vtk_viewer)
+ vtk_viewer = dynamic_cast<SVTK_Viewer*>( aViewFrame );
if( vtk_viewer )
{
SVTK_ViewWindow* wnd =
void VisuGUI_Displayer::buildPrs3d( SVTK_ViewWindow* wnd, VISU::Prs3d_i* thePrs ) const
{
- VISU_Actor* newAct = VISU::FindActor( wnd, thePrs );
- if( !newAct )
- {
- newAct = thePrs->CreateActor();
+ VISU_Actor* newAct = VISU::FindActor(wnd, thePrs);
+ if (!newAct) {
+ try {
+ newAct = thePrs->CreateActor();
+ } catch (std::runtime_error& exc) {
+ thePrs->RemoveActors();
+
+ INFOS(exc.what());
+ SUIT_MessageBox::warn1
+ (myApp->desktop(), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()),
+ QObject::tr("BUT_OK"));
+ }
}
- if( newAct )
- {
- wnd->AddActor( newAct );
+ if (newAct) {
+ wnd->AddActor(newAct);
wnd->Repaint();
}
}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VisuGUI_EditContainerDlg.cxx
// Author : VSV
#include "SalomeApp_Application.h"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
#include <qlayout.h>
#include <qcheckbox.h>
buttonCancel->setAutoDefault(TRUE);
GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
+ QPushButton* buttonHelp = new QPushButton(tr("&Help") , GroupButtons, "buttonHelp");
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
+
TopLayout->addWidget(GroupButtons);
connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
}
void VisuGUI_EditContainerDlg::initFromPrsObject (VISU::Container_i* theContainer)
}
myLeftBtn->setEnabled(isSelected);
}
+
+void VisuGUI_EditContainerDlg::onHelp()
+{
+ QString aHelpFileName = "/files/creating_xy_plot.htm";
+ SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VisuGUI_EditContainerDlg.h
// Author : VSV
void onRightClicked();
void onLeftSelected();
void onRightSelected();
+ void onHelp();
private:
QString getSObjectName (_PTR(SObject) theSObject);
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
-// SALOME SALOMEGUI : GUI of VISU module
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VisuGUI_FileDlg.cxx
// Author :
-// SALOME SALOMEGUI : GUI of VISU module
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VisuGUI_FileDlg.h
// Author :
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "VVTK_PrimitiveBox.h"
#include "VVTK_SizeBox.h"
-#include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
#include "SalomeApp_Module.h"
#include "SUIT_Desktop.h"
#include "SUIT_ResourceMgr.h"
const VISU::TNames& aCompNames = aField->myCompNames;
const VISU::TNames& aUnitNames = aField->myUnitNames;
for(int i = 0; i < aNbComp; i++){
- QString aComponent = QString(aCompNames[i]).simplifyWhiteSpace();
+ QString aComponent = QString(aCompNames[i].c_str()).simplifyWhiteSpace();
if(aComponent.isNull() || aComponent == "")
aComponent = "Component " + QString::number(i+1);
else
aComponent = "[" + QString::number(i+1) + "] " + aComponent;
- QString anUnit = QString(aUnitNames[i]).simplifyWhiteSpace();
+ QString anUnit = QString(aUnitNames[i].c_str()).simplifyWhiteSpace();
if(anUnit.isNull() || anUnit == "")
anUnit = "-";
// "Title"
myTextDlg->setTitleText(QString(thePrs->GetTitle()));
- float R, G, B;
+ vtkFloatingPointType R, G, B;
thePrs->GetTitleColor(&R, &G, &B);
myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)),
buttonCancel->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
+ QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" );
+ buttonHelp->setAutoDefault( TRUE );
+ GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
+
TopLayout->addWidget( PrsGroup );
TopLayout->addWidget( aTabBox );
TopLayout->addWidget( GroupButtons );
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
}
void VisuGUI_GaussPointsDlg::initFromPrsObject( VISU::GaussPoints_i* thePrs )
//if( myScalarPane->check() )
QDialog::accept();
}
+
+void VisuGUI_GaussPointsDlg::onHelp()
+{
+ QString aHelpFileName = "types_of_gauss_points_presentations.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
private slots:
void changeDefaults( int );
- //void changeRange( int );
+//VSR: 08/06/06: void changeRange( int );
void XYChanged( double );
void onTextPref();
void onSetDisplayGlobal();
protected slots:
void onToggleDefShape( bool );
+ void onHelp();
void accept();
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
-#include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
#include <limits.h>
QPushButton* buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" );
buttonCancel->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
+ QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" );
+ buttonHelp->setAutoDefault( TRUE );
+ GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
TopLayout->addWidget(GroupButtons);
// signals and slots connections
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
}
void VisuGUI_IsoSurfacesDlg::accept()
myScalarPane->deletePreview();
QDialog::reject();
}
+
+void VisuGUI_IsoSurfacesDlg::onHelp()
+{
+ QString aHelpFileName = "/files/iso_surfaces_presentation.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+ app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ }
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
protected slots:
void accept();
void reject();
+ void onHelp();
private:
VisuGUI_IsoSurfPane* myIsoPane;
-
+// VISU VISUGUI : GUI of VISU component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "LightApp_SelectionMgr.h"
#include "LightApp_VTKSelector.h"
#include "LightApp_Preferences.h"
+#include "LightApp_Displayer.h"
+
+#include "SALOMEDSClient_ClientFactory.hxx"
+#include "SALOMEDSClient_IParameters.hxx"
#include "VVTK_ViewManager.h"
#include "VVTK_ViewWindow.h"
#include "VISU_Event.h"
#include "VisuGUI_Prs3dTools.h"
+#include "VisuGUI_ClippingDlg.h"
#include "VISU_GaussPoints_i.hh"
#include "VISU_GaussPtsAct.h"
#include "VISU_CutLines_i.hh"
#include "VISU_Actor.h"
+#include "VISU_ScalarMapAct.h"
#include "VisuGUI_Tools.h"
#include "VisuGUI_ActionsDef.h"
#include "VVTK_MainWindow.h"
#include "VISU_View_i.hh"
+#ifndef DISABLE_VTKVIEWER
+#ifndef DISABLE_SALOMEOBJECT
+ #include <SVTK_ViewWindow.h>
+ #include <SVTK_ViewModel.h>
+#else
+ #include <VTKViewer_ViewWindow.h>
+#endif
+ #include <VTKViewer_ViewModel.h>
+#endif
+#ifndef DISABLE_OCCVIEWER
+ #include <OCCViewer_ViewWindow.h>
+ #include <OCCViewer_ViewPort3d.h>
+#ifndef DISABLE_SALOMEOBJECT
+ #include <SOCC_ViewModel.h>
+#else
+ #include <OCCViewer_ViewModel.h>
+#endif
+#endif
+#ifndef DISABLE_GLVIEWER
+ #include <GLViewer_ViewFrame.h>
+ #include <GLViewer_ViewPort.h>
+#endif
+#ifndef DISABLE_PLOT2DVIEWER
+ #include <Plot2d_ViewWindow.h>
+ #include <Plot2d_ViewFrame.h>
+#ifndef DISABLE_SALOMEOBJECT
+ #include <SPlot2d_ViewModel.h>
+#else
+ #include <Plot2d_ViewModel.h>
+#endif
+#endif
+
#include <qaction.h>
#include <vtkRenderer.h>
#include <vtkCamera.h>
#include <vtkTimerLog.h>
+#include <vtkPlane.h>
#include <sstream>
static int MYDEBUG = 0;
#endif
+#define SAVE_VISU_STATE 5090
+
#define GAUSS_NEW_VIEWER 5100
#define GAUSS_CREATE_PRS 5200
#define GAUSS_RENAME 5210
namespace VISU
{
- //---------------------------------------------------------------
- class Viewer
- {
- VVTK_ViewManager* myViewManager;
- LightApp_VTKSelector* mySelector;
- public:
-
- Viewer(VisuGUI_Module* theModule, TViewerMap& theViewerMap)
- {
- SalomeApp_Application* anApp = theModule->getApp();
- myViewManager = new VVTK_ViewManager( anApp->activeStudy(), anApp->desktop() );
- VVTK_Viewer* aViewer = (VVTK_Viewer*)myViewManager->getViewModel();
- mySelector = new LightApp_VTKSelector( aViewer, anApp->selectionMgr() );
- anApp->addViewManager( myViewManager );
-
- theViewerMap.insert(TViewerMap::value_type(myViewManager,PViewer(this)));
- QObject::connect( myViewManager, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
- theModule, SLOT( onLastViewClosed( SUIT_ViewManager* ) ) );
-
- //aViewer->setBackgroundColor( Qt::darkGreen );
- myViewManager->createViewWindow();
- }
-
- VVTK_ViewManager* getViewManager()
- {
- return myViewManager;
- }
-
- virtual
- ~Viewer()
- {
- }
- };
-
-
//---------------------------------------------------------------
typedef void (SUIT_ViewWindow::* TViewVisibility)();
void
- SetViewVisibility(const TViewerMap& theViewerMap,
+ SetViewVisibility(SalomeApp_Application* app,
TViewVisibility theViewVisibility)
{
- TViewerMap::const_iterator anIter = theViewerMap.begin();
- for(; anIter != theViewerMap.end(); anIter++){
- if(SUIT_ViewManager* aViewManager = anIter->first){
+ ViewManagerList l;
+ app->viewManagers( VVTK_Viewer::Type(), l );
+ ViewManagerList::const_iterator anIt = l.begin(), aLast = l.end();
+ for( ; anIt!=aLast; anIt++ )
+ if( SUIT_ViewManager* aViewManager = *anIt )
+ {
QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
int aSize = aViews.size();
- for(int anId = 0; anId < aSize; anId++){
- if(SUIT_ViewWindow* aView = aViews[anId]){
+ for(int anId = 0; anId < aSize; anId++)
+ {
+ if(SUIT_ViewWindow* aView = aViews[anId])
(aView->* theViewVisibility)();
- }
}
}
- }
}
-
}
//---------------------------------------------------------------
-VisuGUI_Module
-::VisuGUI_Module() :
+VisuGUI_Module::
+VisuGUI_Module() :
VisuGUI()
{
}
//---------------------------------------------------------------
-VisuGUI_Module
-::~VisuGUI_Module()
+VisuGUI_Module::
+~VisuGUI_Module()
{
}
//---------------------------------------------------------------
void
-VisuGUI_Module
-::initialize( CAM_Application* theApp )
+VisuGUI_Module::
+initialize( CAM_Application* theApp )
{
VisuGUI::initialize( theApp );
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+ // "Save VISU State" command is moved from SalomeApp_Applicaiton
+ createAction( SAVE_VISU_STATE, tr( "TOT_DESK_FILE_SAVE_GUI_STATE" ), QIconSet(),
+ tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ),
+ 0, getApp()->desktop(), false, getApp(), SLOT( onSaveGUIState() ) );
+ int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
+ createMenu( SAVE_VISU_STATE, fileMenu, 9, -1 );
+
QPixmap aPixmap;
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_NEW_VIEWER"));
createAction( GAUSS_NEW_VIEWER,
int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, 100 );
int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 );
createMenu( action( GAUSS_NEW_VIEWER ), newWinMenu, -1 );
-
+
// Add actions to menus
createMenu( tr( "MEN_GAUSS" ), -1, -1, 30 );
//createMenu( GAUSS_CREATE_PRS, aMenuId, 10 );
accel->setActionKey( SVTK::PlusSpeedIncrementEvent, Key_Plus, aViewerType );
accel->setActionKey( SVTK::MinusSpeedIncrementEvent, Key_Minus, aViewerType );
- connect( getApp(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ), this, SLOT( OnViewManagerAdded (SUIT_ViewManager*) ) );
+ connect( getApp(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ),
+ this, SLOT( OnViewManagerAdded (SUIT_ViewManager*) ) );
// Prepare popup menus
QtxPopupMgr* mgr = popupMgr();
true );
action( GAUSS_COPY_PRS )->setEnabled(false);
+ QStringList viewers;
+
+#ifndef DISABLE_OCCVIEWER
+#ifndef DISABLE_SALOMEOBJECT
+ viewers.append( SOCC_Viewer::Type() );
+#else
+ viewers.append( OCCViewer_Viewer::Type() );
+#endif
+#endif
+#ifndef DISABLE_VTKVIEWER
+#ifndef DISABLE_SALOMEOBJECT
+ viewers.append( SVTK_Viewer::Type() );
+ viewers.append( VVTK_Viewer::Type() );
+#else
+ viewers.append( VTKViewer_Viewer::Type() );
+#endif
+#endif
+#ifndef DISABLE_PLOT2DVIEWER
+#ifndef DISABLE_SALOMEOBJECT
+ viewers.append( SPlot2d_Viewer::Type() );
+#else
+ viewers.append( Plot2d_Viewer::Type() );
+#endif
+#endif
+
+ if( !viewers.isEmpty() )
+ {
+ QString strViewers = "{ ", temp = "'%1' ";
+ QStringList::const_iterator anIt = viewers.begin(), aLast = viewers.end();
+ for( ; anIt!=aLast; anIt++ )
+ strViewers+=temp.arg( *anIt );
+ strViewers+="}";
+ mgr->setRule( action(myEraseAll), QString( "client in %1" ).arg( strViewers ), true );
+ }
+
aRule = "(selcount>0 and type='VISU::TGAUSSPOINTS')";
createAction( GAUSS_ERASE_PRS, VisuGUI::tr("MEN_ERASE"), QIconSet(),
this, SLOT(OnErasePrs()));
mgr->insert( action( GAUSS_ERASE_PRS ), -1, -1, -1 ); // erase
mgr->setRule( action( GAUSS_ERASE_PRS ),
- aRule + " and (isVisible=true)", true );
+ aRule + " and ({true} in $canBeDisplayed) and (isVisible=true)", true );
createAction( GAUSS_DISPLAY_PRS, VisuGUI::tr("MEN_DISPLAY"), QIconSet(),
VisuGUI::tr("MEN_DISPLAY"), "", 0, this, false,
this, SLOT(OnDisplayPrs()));
mgr->insert( action( GAUSS_DISPLAY_PRS ), -1, -1, -1 ); // display
mgr->setRule( action( GAUSS_DISPLAY_PRS ),
- aRule + " and (isVisible=false)", true );
+ aRule + " and ({true} in $canBeDisplayed) and (isVisible=false)", true );
createAction( GAUSS_DISPLAY_ONLY_PRS, VisuGUI::tr("MEN_DISPLAY_ONLY"), QIconSet(),
VisuGUI::tr("MEN_DISPLAY_ONLY"), "", 0, this, false,
this, SLOT(OnDisplayOnlyPrs()));
mgr->insert( action( GAUSS_DISPLAY_ONLY_PRS ), -1, -1, -1 ); // display only
mgr->setRule( action( GAUSS_DISPLAY_ONLY_PRS ),
- aRule, true );
+ aRule + " and ({true} in $canBeDisplayed)", true );
createAction( GAUSS_RENAME_CONFIGURATION, VisuGUI::tr("MEN_RENAME"), QIconSet(),
VisuGUI::tr("MEN_RENAME"), "", 0, this, false,
tr("MEN_SAVE_CONFIGURATION"), "", 0, this, false,
this, SLOT(OnSaveConfiguration()));
mgr->insert( action( GAUSS_SAVE_CONFIGURATION ), -1, -1, -1 );
- mgr->setRule( action( GAUSS_SAVE_CONFIGURATION ), "selcount>=0 and client='VVTK' and activeView='VVTK'", true );
+ mgr->setRule( action( GAUSS_SAVE_CONFIGURATION ),
+ "selcount>=0 and client='VVTK' and activeView='VVTK'", true );
createAction( GAUSS_OVERWRITE_CONFIGURATION, tr("MEN_OVERWRITE_CONFIGURATION"), QIconSet(),
tr("MEN_OVERWRITE_CONFIGURATION"), "", 0, this, false,
//---------------------------------------------------------------
bool
-VisuGUI_Module
-::activateModule( SUIT_Study* theStudy )
+VisuGUI_Module::
+activateModule( SUIT_Study* theStudy )
{
VisuGUI::activateModule( theStudy );
- SetViewVisibility(myViewerMap,&SUIT_ViewWindow::show);
+ SetViewVisibility(getApp(),&SUIT_ViewWindow::show);
return true;
}
//---------------------------------------------------------------
bool
-VisuGUI_Module
-::deactivateModule( SUIT_Study* theStudy )
+VisuGUI_Module::
+deactivateModule( SUIT_Study* theStudy )
{
VisuGUI::deactivateModule( theStudy );
- SetViewVisibility(myViewerMap,&SUIT_ViewWindow::hide);
+ SetViewVisibility(getApp(),&SUIT_ViewWindow::hide);
return true;
}
//---------------------------------------------------------------
SUIT_ViewManager*
-VisuGUI_Module
-::onCreateViewManager()
+VisuGUI_Module::
+onCreateViewManager()
{
- Viewer* aViewer = new Viewer( this, myViewerMap );
- return aViewer->getViewManager();
-}
-
+ SalomeApp_Application* anApp = getApp();
+ SUIT_ResourceMgr* aResourceMgr = anApp->resourceMgr();
+ VVTK_ViewManager* aViewManager = new VVTK_ViewManager( anApp->activeStudy(), anApp->desktop() );
+ VVTK_Viewer* aViewer = (VVTK_Viewer*)aViewManager->getViewModel();
+ aViewer->setBackgroundColor( aResourceMgr->colorValue( "VTKViewer", "background", aViewer->backgroundColor() ) );
+ aViewer->setTrihedronSize( aResourceMgr->integerValue( "VTKViewer", "trihedron_size", aViewer->trihedronSize() ),
+ aResourceMgr->booleanValue( "VTKViewer", "relative_size", aViewer->trihedronRelative() ) );
+ new LightApp_VTKSelector( aViewer, anApp->selectionMgr() );
+ anApp->addViewManager( aViewManager );
+
+ aViewManager->createViewWindow();
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::onLastViewClosed(SUIT_ViewManager* theViewManager)
-{
- myViewerMap.erase(theViewManager);
+ return aViewer->getViewManager();
}
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createPreferences()
+VisuGUI_Module::
+createPreferences()
{
VisuGUI::createPreferences();
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createGaussPointsPreferences()
+VisuGUI_Module::
+createGaussPointsPreferences()
{
int gaussTab = addPreference( tr( "VISU_GAUSS_PREF_TAB_TTL" ) );
int primitiveGr = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL" ), gaussTab );
setPreferenceProperty( primitiveGr, "columns", 1 );
int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
- LightApp_Preferences::Selector, "VISU", "point_sprite_primitive_type" );
+ LightApp_Preferences::Selector, "VISU",
+ "point_sprite_primitive_type" );
QStringList values;
values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) );
LightApp_Preferences::File, "VISU", "point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU", "point_sprite_alpha_threshold" );
+ LightApp_Preferences::DblSpin, "VISU",
+ "point_sprite_alpha_threshold" );
setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
setPreferenceProperty( maxSizePref, "max", 100 );
int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU", "point_sprite_magnification" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "point_sprite_magnification" );
setPreferenceProperty( magnificationPref, "min", 10 );
setPreferenceProperty( magnificationPref, "max", 1000 );
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createInsideCursorPreferences()
+VisuGUI_Module::
+createInsideCursorPreferences()
{
int insideCursorTab = addPreference( tr( "VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL" ) );
setPreferenceProperty( primitiveGr, "columns", 1 );
int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
- LightApp_Preferences::Selector, "VISU", "inside_point_sprite_primitive_type" );
+ LightApp_Preferences::Selector, "VISU",
+ "inside_point_sprite_primitive_type" );
QStringList values;
values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) );
LightApp_Preferences::File, "VISU", "inside_point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU", "inside_point_sprite_alpha_threshold" );
+ LightApp_Preferences::DblSpin, "VISU",
+ "inside_point_sprite_alpha_threshold" );
setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_geom_sphere_resolution" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "inside_geom_sphere_resolution" );
setPreferenceProperty( resolutionPref, "min", 3 );
setPreferenceProperty( resolutionPref, "max", 100 );
int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_geom_sphere_face_limit" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "inside_geom_sphere_face_limit" );
setPreferenceProperty( faceLimitPref, "min", 10 );
setPreferenceProperty( faceLimitPref, "max", 1000000 );
setPreferenceProperty( sizeGr, "columns", 2 );
int minSizePref = addPreference( tr( "VISU_GAUSS_PREF_MIN_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_min_size" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "inside_point_sprite_min_size" );
setPreferenceProperty( minSizePref, "min", 1 );
setPreferenceProperty( minSizePref, "max", 100 );
int maxSizePref = addPreference( tr( "VISU_GAUSS_PREF_MAX_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_max_size" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "inside_point_sprite_max_size" );
setPreferenceProperty( maxSizePref, "min", 1 );
setPreferenceProperty( maxSizePref, "max", 100 );
setPreferenceProperty( magnificationGr, "columns", 2 );
int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), magnificationGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_magnification" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "inside_point_sprite_magnification" );
setPreferenceProperty( magnificationPref, "min", 10 );
setPreferenceProperty( magnificationPref, "max", 1000 );
int incrementPref = addPreference( tr( "VISU_GAUSS_PREF_INCREMENT" ), magnificationGr,
- LightApp_Preferences::DblSpin, "VISU", "inside_point_sprite_increment" );
+ LightApp_Preferences::DblSpin, "VISU",
+ "inside_point_sprite_increment" );
setPreferenceProperty( incrementPref, "min", 0.01 );
setPreferenceProperty( incrementPref, "max", 10 );
setPreferenceProperty( incrementPref, "step", 0.1 );
-
}
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createOutsideCursorPreferences()
+VisuGUI_Module::
+createOutsideCursorPreferences()
{
int outsideCursorTab = addPreference( tr( "VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL" ) );
setPreferenceProperty( primitiveGr, "columns", 1 );
int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
- LightApp_Preferences::Selector, "VISU", "outside_point_sprite_primitive_type" );
+ LightApp_Preferences::Selector, "VISU",
+ "outside_point_sprite_primitive_type" );
QStringList values;
values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) );
LightApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU", "outside_point_sprite_alpha_threshold" );
+ LightApp_Preferences::DblSpin, "VISU",
+ "outside_point_sprite_alpha_threshold" );
setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "outside_geom_sphere_resolution" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "outside_geom_sphere_resolution" );
setPreferenceProperty( resolutionPref, "min", 3 );
setPreferenceProperty( resolutionPref, "max", 100 );
int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "outside_geom_sphere_face_limit" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "outside_geom_sphere_face_limit" );
setPreferenceProperty( faceLimitPref, "min", 10 );
setPreferenceProperty( faceLimitPref, "max", 1000000 );
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createPickingPreferences()
+VisuGUI_Module::
+createPickingPreferences()
{
int pickingTab = addPreference( tr( "VISU_PICKING_PREF_TAB_TTL" ) );
setPreferenceProperty( cursorGr, "columns", 1 );
int cursorSizePref = addPreference( tr( "VISU_PICKING_PREF_CURSOR_SIZE" ), cursorGr,
- LightApp_Preferences::DblSpin, "VISU", "picking_cursor_size" );
+ LightApp_Preferences::DblSpin, "VISU", "picking_cursor_size" );
setPreferenceProperty( cursorSizePref, "min", 0 );
setPreferenceProperty( cursorSizePref, "max", 1.0 );
setPreferenceProperty( cursorSizePref, "step", 0.1 );
setPreferenceProperty( pyramidHeightPref, "min", 1 );
setPreferenceProperty( pyramidHeightPref, "max", 100 );
- int selectionColorPref = addPreference( tr( "VISU_PICKING_PREF_SELECTION_COLOR" ), cursorGr,
- LightApp_Preferences::Color, "VISU", "picking_selection_color" );
+ /*int selectionColorPref = */
+ addPreference( tr( "VISU_PICKING_PREF_SELECTION_COLOR" ), cursorGr,
+ LightApp_Preferences::Color, "VISU", "picking_selection_color" );
// Tolerance
int toleranceGr = addPreference( tr( "VISU_PICKING_PREF_TOLERANCE_GROUP_TTL" ), pickingTab );
int pointTolerancePref = addPreference( tr( "VISU_PICKING_PREF_POINT_SELECTION_TOLERANCE" ), toleranceGr,
- LightApp_Preferences::DblSpin, "VISU", "picking_point_tolerance" );
+ LightApp_Preferences::DblSpin, "VISU", "picking_point_tolerance" );
setPreferenceProperty( pointTolerancePref, "min", 0.001 );
setPreferenceProperty( pointTolerancePref, "max", 10 );
setPreferenceProperty( pointTolerancePref, "step", 0.01 );
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createSpaceMousePreferences()
+VisuGUI_Module::
+createSpaceMousePreferences()
{
int mouseTab = addPreference( tr( "VISU_MOUSE_PREF_TAB_TLT" ) );
int mouseGr = addPreference( tr( "VISU_MOUSE_PREF_GROUP_TLT" ), mouseTab );
- int mousePref = addPreference( tr( "VISU_MOUSE_PREF" ), mouseGr, LightApp_Preferences::Selector, "VISU", "mouse_behaviour" );
+ int mousePref = addPreference( tr( "VISU_MOUSE_PREF" ), mouseGr,
+ LightApp_Preferences::Selector, "VISU", "mouse_behaviour" );
QStringList values;
values.append( tr( "VISU_MOUSE_PREF_STANDARD" ) );
values.append( tr( "VISU_MOUSE_PREF_KEYBOARD_FREE" ) );
setPreferenceProperty( mousePref, "indexes", indices );
int keybrdGr = addPreference( tr( "VISU_KEYBOARD_PREF_GROUP_TTL" ), mouseTab );
- int keybrdPref = addPreference( tr( "VISU_KEYBOARD_PREF" ), keybrdGr, LightApp_Preferences::IntSpin, "VISU", "speed_increment" );
+ int keybrdPref = addPreference( tr( "VISU_KEYBOARD_PREF" ), keybrdGr,
+ LightApp_Preferences::IntSpin, "VISU", "speed_increment" );
setPreferenceProperty( keybrdPref, "max", 1000 );
int spacemouseGr = addPreference( tr( "VISU_SPACEMOUSE_PREF" ), mouseTab );
setPreferenceProperty( spacemouseGr, "columns", 1 );
- int spacemousePref1 = addPreference( tr( "VISU_SPACEMOUSE_PREF_1" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func1_btn" ); //decrease_speed_increment
- int spacemousePref2 = addPreference( tr( "VISU_SPACEMOUSE_PREF_2" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func2_btn" ); //increase_speed_increment
- int spacemousePref3 = addPreference( tr( "VISU_SPACEMOUSE_PREF_3" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func3_btn" ); //decrease_gauss_point_magnification
- int spacemousePref4 = addPreference( tr( "VISU_SPACEMOUSE_PREF_4" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func4_btn" ); //increase_gauss_point_magnification
- int spacemousePref5 = addPreference( tr( "VISU_SPACEMOUSE_PREF_5" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func5_btn" ); //dominant_combined_switch
+ int spacemousePref1 = addPreference( tr( "VISU_SPACEMOUSE_PREF_1" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func1_btn" ); //decrease_speed_increment
+ int spacemousePref2 = addPreference( tr( "VISU_SPACEMOUSE_PREF_2" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func2_btn" ); //increase_speed_increment
+ int spacemousePref3 = addPreference( tr( "VISU_SPACEMOUSE_PREF_3" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func3_btn" ); //decrease_gauss_point_magnification
+ int spacemousePref4 = addPreference( tr( "VISU_SPACEMOUSE_PREF_4" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func4_btn" ); //increase_gauss_point_magnification
+ int spacemousePref5 = addPreference( tr( "VISU_SPACEMOUSE_PREF_5" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func5_btn" ); //dominant_combined_switch
values.clear();
values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_1" ) );
values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_2" ) );
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createRecorderPreferences()
+VisuGUI_Module::
+createRecorderPreferences()
{
int recorderTab = addPreference( tr( "VISU_RECORDER_PREF_TAB_TTL" ) );
//---------------------------------------------------------------
void
-VisuGUI_Module
-::OnCreateGaussPoints()
+VisuGUI_Module::
+OnCreateGaussPoints()
{
double initialTime = vtkTimerLog::GetCPUTime();
- CreatePrs3d<VISU::GaussPoints_i,VVTK_Viewer,VisuGUI_GaussPointsDlg,1>(this,true);
+ CreatePrs3d<VISU::GaussPoints_i, VVTK_Viewer, VisuGUI_GaussPointsDlg, 1>(this);
INFOS( "VisuGUI_Module::OnCreateGaussPoints() : Gauss Points created in " <<
vtkTimerLog::GetCPUTime() - initialTime << " seconds" );
}
void
-VisuGUI_Module
-::OnViewManagerAdded(SUIT_ViewManager* viewMgr)
+VisuGUI_Module::
+OnViewManagerAdded(SUIT_ViewManager* viewMgr)
{
QString type = viewMgr->getViewModel()->getType();
if ( type == VVTK_Viewer::Type() )
- connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ), this, SLOT( OnViewCreated( SUIT_ViewWindow* ) ) );
+ connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ),
+ this, SLOT( OnViewCreated( SUIT_ViewWindow* ) ) );
}
void
-VisuGUI_Module
-::OnViewCreated(SUIT_ViewWindow* view)
+VisuGUI_Module::
+OnViewCreated(SUIT_ViewWindow* view)
{
SVTK_ViewWindow* viewWindow = dynamic_cast<SVTK_ViewWindow*>( view );
if ( viewWindow ) {
}
void
-VisuGUI_Module
-::setProperty( SVTK_ViewWindow* viewWindow, const QString& pref )
+VisuGUI_Module::
+setProperty( SVTK_ViewWindow* viewWindow, const QString& pref )
{
if ( !viewWindow )
return;
}
void
-VisuGUI_Module
-::setProperty( SVTK_ViewManager* vm, const QString& prop )
+VisuGUI_Module::
+setProperty( SVTK_ViewManager* vm, const QString& prop )
{
if ( !vm )
return;
}
void
-VisuGUI_Module
-::preferencesChanged( const QString& group, const QString& pref )
+VisuGUI_Module::
+preferencesChanged( const QString& group, const QString& pref )
{
VisuGUI::preferencesChanged(group,pref);
//---------------------------------------------------------------
SUIT_ViewManager*
-VisuGUI_Module
-::getViewManager(const QString& theType,
- const bool theIsCreate)
+VisuGUI_Module::
+getViewManager(const QString& theType,
+ const bool theIsCreate)
{
- if(SUIT_ViewManager* aViewManager = VisuGUI::getViewManager(theType,theIsCreate))
+ if (SUIT_ViewManager* aViewManager = VisuGUI::getViewManager(theType,theIsCreate))
return aViewManager;
- if(theIsCreate && VVTK_Viewer::Type() == theType)
+ if (theIsCreate && theType == VVTK_Viewer::Type())
return onCreateViewManager();
return NULL;
//---------------------------------------------------------------
void
-VisuGUI_Module
-::OnEditGaussPoints()
+VisuGUI_Module::
+OnEditGaussPoints()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::GaussPoints_i,VisuGUI_GaussPointsDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow<VVTK_Viewer>(this,true)){
- aViewWindow->highlight(anIO,1);
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) {
+ // Create VVTK_ViewWindow, if it does not exist
+ if (VVTK_ViewWindow* aViewWindow = GetViewWindow<VVTK_Viewer>(this)) {
+ EditPrs3d<VISU::GaussPoints_i, VisuGUI_GaussPointsDlg, 1>(this, anIO, aPrs3d, aViewWindow);
}
}
}
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnDisplayPrs()
-{
- if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs");
-
- QApplication::setOverrideCursor(Qt::waitCursor);
-
- if(LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this)){
- SALOME_ListIO aSel, aList;
- aSelectionMgr->selectedObjects(aSel);
- extractContainers(aSel, aList);
-
- for(SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next()){
- Handle(SALOME_InteractiveObject) anIO = it.Value();
- CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
-
- // is it a Prs3d object ?
- if(!CORBA::is_nil(anObject)){
- if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in())){
- if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs : Prs3d object");
- if(aPrs3d->GetType() == VISU::TGAUSSPOINTS)
- VISU::UpdateViewer<VVTK_Viewer>(this,aPrs3d,false,true,true);
- else if(SUIT_ViewManager* aViewManager = getApp()->activeViewManager()){
- QString aType = aViewManager->getType();
- if(aType == SVTK_Viewer::Type())
- VISU::UpdateViewer<SVTK_Viewer>(this,aPrs3d,false,true,true);
- else if(aType == VVTK_Viewer::Type())
- VISU::UpdateViewer<VVTK_Viewer>(this,aPrs3d,false,true,true);
- }
- continue;
- }
- }
-
- // is it Curve ?
- if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in())){
- if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs : Curve object");
- PlotCurve( this, aCurve, VISU::eDisplay );
- continue;
- }
-
- // is it Container ?
- if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(anObject).in())){
- if(MYDEBUG) MESSAGE("VisuGUI_Module::DisplayPrs : Container object");
- PlotContainer( this, aContainer, VISU::eDisplay );
- continue;
- }
-
- // is it Table ?
- if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(anObject).in())){
- if(MYDEBUG) MESSAGE("VisuGUI_Module::DisplayPrs : Table object");
- PlotTable( this, aTable, VISU::eDisplay );
- continue;
- }
- }
- }
-
- QApplication::restoreOverrideCursor();
-}
-
-
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnEraseAll()
-{
- if(SUIT_ViewManager* aViewManager = getApp()->activeViewManager()){
- QString aType = aViewManager->getType();
- if(aType == SVTK_Viewer::Type())
- VISU::OnEraseAll<SVTK_Viewer>(this);
- else if(aType == VVTK_Viewer::Type())
- VISU::OnEraseAll<VVTK_Viewer>(this);
- else if(aType == SPlot2d_Viewer::Type())
- VISU::OnEraseAll<SPlot2d_Viewer>(this);
- }
-}
-
-
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnDisplayOnlyPrs()
-{
- OnEraseAll();
- OnDisplayPrs();
-}
-
-
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnErasePrs()
-{
- QApplication::setOverrideCursor(Qt::waitCursor);
-
- LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
- SALOME_ListIO aSel, aList;
- aSelectionMgr->selectedObjects(aSel);
- extractContainers(aSel, aList);
-
- for(SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next()){
- Handle(SALOME_InteractiveObject) anIO = it.Value();
- CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this),anIO->getEntry());
- if(!CORBA::is_nil(anObject)){
- VISU::Base_var aBase = VISU::Base::_narrow(anObject);
- if(!CORBA::is_nil(aBase))
- VISU::ErasePrs(this,aBase,true);
- }
- }
-
- QApplication::restoreOverrideCursor();
-}
-
-
//---------------------------------------------------------------
namespace
{
const char* theSuffix,
std::ostringstream& theStr)
{
- float aColor[3];
+ vtkFloatingPointType aColor[3];
vtkRenderer* aRenderer = theViewWindow->getRenderer();
aRenderer->GetBackground(aColor);
- Storable::DataToStream(theStr,std::string("myColor") + theSuffix + ".R",aColor[0]);
- Storable::DataToStream(theStr,std::string("myColor") + theSuffix + ".G",aColor[1]);
- Storable::DataToStream(theStr,std::string("myColor") + theSuffix + ".B",aColor[2]);
+ Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".R").c_str(),aColor[0]);
+ Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".G").c_str(),aColor[1]);
+ Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".B").c_str(),aColor[2]);
double aPosition[3];
vtkCamera* aCamera = aRenderer->GetActiveCamera();
aCamera->GetPosition(aPosition);
- Storable::DataToStream(theStr,std::string("myPosition") + theSuffix + "[0]",aPosition[0]);
- Storable::DataToStream(theStr,std::string("myPosition") + theSuffix + "[1]",aPosition[1]);
- Storable::DataToStream(theStr,std::string("myPosition") + theSuffix + "[2]",aPosition[2]);
+ Storable::DataToStream(theStr,(std::string("myPosition") + theSuffix + "[0]").c_str(),aPosition[0]);
+ Storable::DataToStream(theStr,(std::string("myPosition") + theSuffix + "[1]").c_str(),aPosition[1]);
+ Storable::DataToStream(theStr,(std::string("myPosition") + theSuffix + "[2]").c_str(),aPosition[2]);
double aFocalPnt[3];
aCamera->GetFocalPoint(aFocalPnt);
- Storable::DataToStream(theStr,std::string("myFocalPnt") + theSuffix + "[0]",aFocalPnt[0]);
- Storable::DataToStream(theStr,std::string("myFocalPnt") + theSuffix + "[1]",aFocalPnt[1]);
- Storable::DataToStream(theStr,std::string("myFocalPnt") + theSuffix + "[2]",aFocalPnt[2]);
+ Storable::DataToStream(theStr,(std::string("myFocalPnt") + theSuffix + "[0]").c_str(),aFocalPnt[0]);
+ Storable::DataToStream(theStr,(std::string("myFocalPnt") + theSuffix + "[1]").c_str(),aFocalPnt[1]);
+ Storable::DataToStream(theStr,(std::string("myFocalPnt") + theSuffix + "[2]").c_str(),aFocalPnt[2]);
double aViewUp[3];
aCamera->GetViewUp(aViewUp);
- Storable::DataToStream(theStr,std::string("myViewUp") + theSuffix + "[0]",aViewUp[0]);
- Storable::DataToStream(theStr,std::string("myViewUp") + theSuffix + "[1]",aViewUp[1]);
- Storable::DataToStream(theStr,std::string("myViewUp") + theSuffix + "[2]",aViewUp[2]);
+ Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[0]").c_str(),aViewUp[0]);
+ Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[1]").c_str(),aViewUp[1]);
+ Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[2]").c_str(),aViewUp[2]);
- float aParallelScale = aCamera->GetParallelScale();
- Storable::DataToStream(theStr,std::string("myParallelScale") + theSuffix,aParallelScale);
+ vtkFloatingPointType aParallelScale = aCamera->GetParallelScale();
+ Storable::DataToStream(theStr,(std::string("myParallelScale") + theSuffix).c_str(),aParallelScale);
double aScaleFactor[3];
theViewWindow->GetScale(aScaleFactor);
- Storable::DataToStream(theStr,std::string("myScaleFactor") + theSuffix + "[0]",aScaleFactor[0]);
- Storable::DataToStream(theStr,std::string("myScaleFactor") + theSuffix + "[1]",aScaleFactor[1]);
- Storable::DataToStream(theStr,std::string("myScaleFactor") + theSuffix + "[2]",aScaleFactor[2]);
+ Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[0]").c_str(),aScaleFactor[0]);
+ Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[1]").c_str(),aScaleFactor[1]);
+ Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[2]").c_str(),aScaleFactor[2]);
}
//---------------------------------------------------------------
const char* theSuffix,
const Storable::TRestoringMap& theMap)
{
- float aColor[3];
+ vtkFloatingPointType aColor[3];
aColor[0] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".R").toDouble();
aColor[1] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".G").toDouble();
aColor[2] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".B").toDouble();
aViewUp[2] = Storable::FindValue(theMap,std::string("myViewUp") + theSuffix + "[2]").toDouble();
aCamera->SetViewUp(aViewUp);
- float aParallelScale = Storable::FindValue(theMap,std::string("myParallelScale") + theSuffix).toDouble();
+ vtkFloatingPointType aParallelScale = Storable::FindValue(theMap,std::string("myParallelScale") + theSuffix).toDouble();
aCamera->SetParallelScale(aParallelScale);
double aScaleFactor[3];
std::string aSegmentationMode;
if(aWidgetCtrl->IsPlanesActive()){
VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
- float anOrigin[3];
+ vtkFloatingPointType anOrigin[3];
aPlanesWidget->GetOrigin(anOrigin);
Storable::DataToStream(theStr,"myCursorOrigin[0]",anOrigin[0]);
Storable::DataToStream(theStr,"myCursorOrigin[1]",anOrigin[1]);
Storable::DataToStream(theStr,"myCursorOrigin[2]",anOrigin[2]);
- float aNormal[3];
+ vtkFloatingPointType aNormal[3];
aPlanesWidget->GetNormal(aNormal);
Storable::DataToStream(theStr,"myCursorNormal[0]",aNormal[0]);
Storable::DataToStream(theStr,"myCursorNormal[1]",aNormal[1]);
Storable::DataToStream(theStr,"myCursorNormal[2]",aNormal[2]);
- float aDepth = aPlanesWidget->Distance();
+ vtkFloatingPointType aDepth = aPlanesWidget->Distance();
Storable::DataToStream(theStr,"myCursorDepth",aDepth);
aSegmentationMode = "Planes";
}else if(aWidgetCtrl->IsSphereActive()){
VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
- float aCenter[3];
+ vtkFloatingPointType aCenter[3];
aSphereWidget->GetCenter(aCenter);
Storable::DataToStream(theStr,"mySphereCursorCenter[0]",aCenter[0]);
Storable::DataToStream(theStr,"mySphereCursorCenter[1]",aCenter[1]);
Storable::DataToStream(theStr,"mySphereCursorCenter[2]",aCenter[2]);
- float aRadius = aSphereWidget->GetRadius();
+ vtkFloatingPointType aRadius = aSphereWidget->GetRadius();
Storable::DataToStream(theStr,"mySphereCursorRaduis",aRadius);
aSegmentationMode = "Sphere";
}
- Storable::DataToStream(theStr,"mySegmentationMode",aSegmentationMode);
+ Storable::DataToStream(theStr,"mySegmentationMode",aSegmentationMode.c_str());
}
}
PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in())){
// To set visiblity
- VISU::UpdateViewer<VVTK_Viewer>(theModule,aPrs3d,anIsFirst,false,false);
+ VISU::UpdateViewer(theModule, aPrs3d, /*disp_only = */anIsFirst, /*highlight = */false);
anIsFirst = false;
// To update selection
if(aSegmentationMode == "Planes"){
VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
- float anOrigin[3];
+ vtkFloatingPointType anOrigin[3];
anOrigin[0] = Storable::FindValue(aMap,"myCursorOrigin[0]").toDouble();
anOrigin[1] = Storable::FindValue(aMap,"myCursorOrigin[1]").toDouble();
anOrigin[2] = Storable::FindValue(aMap,"myCursorOrigin[2]").toDouble();
aPlanesWidget->SetOrigin(anOrigin);
- float aNormal[3];
+ vtkFloatingPointType aNormal[3];
aNormal[0] = Storable::FindValue(aMap,"myCursorNormal[0]").toDouble();
aNormal[1] = Storable::FindValue(aMap,"myCursorNormal[1]").toDouble();
aNormal[2] = Storable::FindValue(aMap,"myCursorNormal[2]").toDouble();
aPlanesWidget->SetNormal(aNormal);
- float aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble();
+ vtkFloatingPointType aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble();
aPlanesWidget->SetDistance(aDepth);
aMainWindow->SetPlanesSegementation(true);
}else if(aSegmentationMode == "Sphere"){
VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
- float aCenter[3];
+ vtkFloatingPointType aCenter[3];
aCenter[0] = Storable::FindValue(aMap,"mySphereCursorCenter[0]").toDouble();
aCenter[1] = Storable::FindValue(aMap,"mySphereCursorCenter[1]").toDouble();
aCenter[2] = Storable::FindValue(aMap,"mySphereCursorCenter[2]").toDouble();
aSphereWidget->SetCenter(aCenter);
- float aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble();
+ vtkFloatingPointType aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble();
aSphereWidget->SetRadius(aRadius);
aMainWindow->SetSphereSegementation(true);
}
return aRet;
}
+
+
+const char gSeparator = '_'; // character used to separate parameter names
+const char gDigitsSep = ':'; // character used to separate numeric parameter values (color = r:g:b)
+/*!
+ * \brief Virtual public
+ *
+ * This method is called just before the study document is saved, so the module has a possibility
+ * to store visual parameters in AttributeParameter attribue(s)
+ */
+void VisuGUI_Module::storeVisualParameters(int savePoint)
+{
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+ if( !study || !study->studyDS() )
+ return;
+ _PTR(Study) studyDS = study->studyDS();
+ _PTR(AttributeParameter) ap = studyDS->GetModuleParameters("Interface Applicative", moduleName().latin1(), savePoint);
+ _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
+
+ // viewers counters are used for storing view_numbers in IParameters
+ int svtkViewers( 0 ), vvtkViewers( 0 ), plotViewers( 0 );
+
+ // componentName is used for encoding of entries when storing them in IParameters
+ _PTR(SComponent) visuEng = ClientFindOrCreateVisuComponent( studyDS );
+ std::string componentName = visuEng->ComponentDataType();
+
+ QPtrList<SUIT_ViewManager> lst;
+
+ // saving VVTK viewer parameters. VVTK (Gauss Viewers) are NOT created by SalomeApp since
+ // VVTK is declared in VISU, so here we store VVTK view window parameters.
+ // VisuGUI_Module::restoreVisualParameters() creates VVTK_Views and restores its parameters.
+ ip->setProperty( "ActiveGaussViewer", "-1" );
+ getApp()->viewManagers( VVTK_Viewer::Type(), lst );
+ for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it ) {
+ SUIT_ViewManager* vman = it.current();
+ if ( SUIT_ViewWindow* vwin = vman->getActiveView() ) {
+ // using predefined string "GaussViewer" as "entry".. it's a hardcoded "workaround".
+ // gauss viewer parameters are retrieved using this "entry" string.
+ // name of parameter = caption of gauss ViewWindow
+ // value of parameter = ViewWindow's visual parameters
+ ip->setParameter( "GaussViewer", vwin->caption().latin1(), vwin->getVisualParameters().latin1() );
+
+ if ( application()->desktop()->activeWindow() == vwin )
+ ip->setProperty( "ActiveGaussViewer", QString::number( vvtkViewers ).latin1() );
+ vvtkViewers++;
+ }
+ }
+
+ // VISU module opens one SVTK viewer in activateModule(). This causes a bug in save-restore visual
+ // parameters: it no SVTK view was saved, we need NOT any SVTK on restore. Here we store if any is open..
+ /*
+ lst.clear();
+ getApp()->viewManagers( SVTK_Viewer::Type(), lst );
+ ip->setProperty( "VtkViewersCount", QString::number( lst.count() ).latin1() );
+ */
+
+ // main cycle to store parameters of displayed objects
+ lst.clear();
+ getApp()->viewManagers( lst );
+ vvtkViewers = svtkViewers = plotViewers = 0;
+ for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it ) {
+ SUIT_ViewManager* vman = it.current();
+ QString vType = vman->getType();
+ int* viewsCounter = vType == SVTK_Viewer::Type() ? &svtkViewers :
+ vType == VVTK_Viewer::Type() ? &vvtkViewers :
+ vType == SPlot2d_Viewer::Type() ? &plotViewers : 0;
+
+ // saving VTK actors' properties
+ if ( vType == SVTK_Viewer::Type() || // processing SVTK and VVTK viewers in the same
+ vType == VVTK_Viewer::Type() ) { // way (VVTK_ViewWindow inherits SVTK_ViewWindow)
+
+ QPtrVector<SUIT_ViewWindow> views = vman->getViews();
+ for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) {
+ if ( SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>( views[i] ) ) {
+ vtkActorCollection* allActors = vtkView->getRenderer()->GetActors();
+ allActors->InitTraversal();
+ while ( vtkActor* actor = allActors->GetNextActor() ) {
+ if ( actor->GetVisibility() ) { // store only visible actors
+ if ( VISU_Actor* vActor = VISU_Actor::SafeDownCast( actor ) ) {
+ if ( vActor->hasIO() ) { // actor corresponds to existing obj
+
+ Handle(SALOME_InteractiveObject) io = vActor->getIO();
+ // entry is "ecoded" = it does NOT contain component adress, since it is a
+ // subject to change on next component loading
+ std::string entry = ip->encodeEntry( io->getEntry(), componentName );
+
+ std::string param, vtkParam = vType.latin1(); vtkParam += gSeparator;
+ vtkParam += QString::number( *viewsCounter ).latin1(); vtkParam += gSeparator;
+
+ param = vtkParam + "Visibility";
+ ip->setParameter( entry, param, "On" );
+ param = vtkParam + "Name";
+ ip->setParameter( entry, param, vActor->getName() );
+ param = vtkParam + "RepresentationMode";
+ ip->setParameter( entry, param, QString::number( vActor->GetRepresentation() ).latin1() );
+ param = vtkParam + "Opacity";
+ ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).latin1() );
+ vtkFloatingPointType r, g, b;
+ vActor->GetColor(r, g, b);
+ QString colorStr = QString::number( r ); colorStr += gDigitsSep;
+ colorStr += QString::number( g ); colorStr += gDigitsSep;
+ colorStr += QString::number( b );
+ param = vtkParam + "Color";
+ ip->setParameter( entry, param, colorStr.latin1() );
+ param = vtkParam + "LineWidth";
+ ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).latin1() );
+ if ( vActor->IsShrunkable() && vActor->IsShrunk() ) {
+ param = vtkParam + "ShrinkMode";
+ ip->setParameter( entry, param, "On" );
+ param = vtkParam + "ShrinkFactor";
+ ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).latin1() );
+ }
+ VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor );
+ if ( scalarMapActor && scalarMapActor->IsShading() ) {
+ param = vtkParam + "Shading";
+ ip->setParameter( entry, param, "On" );
+ }
+ if ( const VISU::Prs3d_i* vPrs = vActor->GetPrs3d() ) {
+ param = vtkParam + "ClippingPlane";
+ int nPlanes = vPrs->GetNumberOfClippingPlanes();
+ if ( !nPlanes )
+ ip->setParameter( entry, param, "Off" );
+ for ( int p = 0; p < nPlanes; p++ ) {
+ vtkPlane* plane = vPrs->GetClippingPlane( p );
+ vtkFloatingPointType normal[3], origin[3];
+ plane->GetNormal( normal );
+ plane->GetOrigin( origin );
+ std::string planeValue = QString::number( normal[0] ).latin1(); planeValue += gDigitsSep;
+ planeValue += QString::number( normal[1] ).latin1(); planeValue += gDigitsSep;
+ planeValue += QString::number( normal[2] ).latin1(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[0] ).latin1(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[1] ).latin1(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[2] ).latin1();
+ param = QString( "%1ClippingPlane_%2" ).arg( vtkParam.c_str() ).arg( p+1 ).latin1();
+ ip->setParameter( entry, param, planeValue );
+ }
+ }
+
+ } // hasIO
+ } // salome_actor successfull downcast
+ } // isVisible
+ } // end of ..while.. actors traversal
+ } // if ( vtkView )
+ } // for ( views )
+ (*viewsCounter)++;
+ } // if ( SVTK view model )
+ else if ( vType == SPlot2d_Viewer::Type() ) { // processing Plot2d viewers
+ QPtrVector<SUIT_ViewWindow> views = vman->getViews();
+ for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) {
+ if ( Plot2d_ViewWindow* plotView = dynamic_cast<Plot2d_ViewWindow*>( views[i] ) ) {
+ Plot2d_ViewFrame* plotVF = plotView->getViewFrame();
+ QPtrList<Plot2d_Curve> curves;
+ plotVF->getCurves( curves );
+
+ Plot2d_Curve* curve;
+ for ( curve = curves.first(); curve; curve = curves.next() ) {
+ if ( SPlot2d_Curve* sCurve = dynamic_cast<SPlot2d_Curve*>( curve ) ) {
+ if ( sCurve->hasIO() ) {
+
+ Handle(SALOME_InteractiveObject) io = sCurve->getIO();
+ // entry is "ecoded" = it does NOT contain component adress, since it is a
+ // subject to change on next component loading
+ std::string entry = ip->encodeEntry( io->getEntry(), componentName );
+
+ std::string param, plotParam = vType.latin1(); plotParam += gSeparator;
+ plotParam += QString::number( *viewsCounter ).latin1(); plotParam += gSeparator;
+
+ param = plotParam + "Visibility";
+ ip->setParameter( entry, param, "On" );
+ }
+ }
+ } // for curves
+ } // if ( plotView )
+ } // for ( views )
+ (*viewsCounter)++;
+ } // if ( SPlot2d view model )
+ }
+}
+
+// returns VISU_Actor with IO with given entry
+VISU_Actor* getActor( const QString& entry, SVTK_ViewWindow* vtkView )
+{
+ if ( vtkView && !entry.isEmpty() ) {
+ vtkActorCollection* allActors = vtkView->getRenderer()->GetActors();
+ allActors->InitTraversal();
+ while ( vtkActor* actor = allActors->GetNextActor() ) {
+ if ( VISU_Actor* vActor = VISU_Actor::SafeDownCast( actor ) ) {
+ if ( vActor->hasIO() ) { // actor corresponds to existing obj
+ Handle(SALOME_InteractiveObject) io = vActor->getIO();
+ if ( entry == io->getEntry() )
+ return vActor;
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+const int ViewerType = 0;
+const int ViewIndex = 1;
+const int ParamName = 2;
+// visual parameters are stored in strings as follows:
+// ViewerType_ViewNumber_ParamName. '_' is used as separator and should not be used in
+// viewer type or parameter names
+
+// return viewer type substring from parameter name
+std::string getParam( const std::string& paramName, const int index )
+{
+ QStringList lst = QStringList::split( gSeparator, QString( paramName.c_str() ) );
+ if ( !lst.isEmpty() && index < lst.size() )
+ return lst[index].latin1();
+ return "";
+}
+
+
+/*!
+ * \brief Virtual public
+ *
+ * This method is called after the study document is opened, so the module has a possibility to restore
+ * visual parameters
+ */
+void VisuGUI_Module::restoreVisualParameters(int savePoint)
+{
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+ if( !study || !study->studyDS() )
+ return;
+ _PTR(Study) studyDS = study->studyDS();
+ _PTR(AttributeParameter) ap = studyDS->GetModuleParameters("Interface Applicative", moduleName().latin1(), savePoint);
+ _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
+
+ // actors are stored in a map after displaying of them for quicker access in future
+ QMap<QString, QMap<QString, VISU_Actor*> > vtkActors; // map: entry to map: ViewType_<ID> to actor (SVTK/VVTK)
+
+ std::vector<std::string> entries = ip->getEntries();
+
+ for ( std::vector<std::string>::iterator entIt = entries.begin(); entIt != entries.end(); ++entIt ) {
+
+ std::vector<std::string> paramNames = ip->getAllParameterNames( *entIt );
+ std::vector<std::string> paramValues = ip->getAllParameterValues( *entIt );
+ std::vector<std::string>::iterator namesIt = paramNames.begin();
+ std::vector<std::string>::iterator valuesIt = paramValues.begin();
+
+ if ( *entIt == "GaussViewer" ) {
+ // parameter names are view window's captions, values - visual parameters.
+ for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) {
+ SUIT_ViewManager* vman = onCreateViewManager();
+ SUIT_ViewWindow* vwin = vman->getActiveView();
+ vwin->setCaption( (*namesIt).c_str() );
+
+ // wait untill the window is really shown. This step fixes MANY bugs..
+ while ( !vwin->isVisible() )
+ qApp->processEvents();
+
+ vwin->setVisualParameters( (*valuesIt).c_str() );
+ }
+ continue; // skip to next entry
+ }
+
+ // entry is a normal entry - it should be "decoded" (setting base adress of component)
+ QString entry( ip->decodeEntry( *entIt ).c_str() );
+
+ //SRN: Added a check that the entry corresponds to Standard_Real object in the Study
+ // as the object may be deleted or modified after the visual state is saved.
+ _PTR(SObject) so = studyDS->FindObjectID(entry.latin1());
+ if(!so) continue; //Skip the not existent entry
+
+ for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) {
+ std::string viewerType = ::getParam( *namesIt, ViewerType );
+
+ std::string paramName = ::getParam( *namesIt, ParamName );
+ bool ok;
+ std::string viewIndexStr = ::getParam( *namesIt, ViewIndex );
+ int viewIndex = QString( viewIndexStr.c_str() ).toUInt( &ok );
+ if ( !ok ) // bad conversion of view index to integer
+ continue;
+
+ // cout << " -- " << viewerType << ": entry = " << entry.latin1() << ", paramName = " << paramName << endl;
+
+ if ( viewerType == SVTK_Viewer::Type().latin1() ||
+ viewerType == VVTK_Viewer::Type().latin1() ) {
+
+ // used as inner map key for locating the actor.
+ QString viewerTypeIndex = QString( viewerType.c_str() ) + QString::number( viewIndex );
+
+ if ( paramName == "Visibility" && displayer() ) {
+ // if VVTK, then we must create viewer first, because
+
+ QPtrList<SUIT_ViewManager> lst;
+ getApp()->viewManagers( viewerType.c_str(), lst );
+
+ // SVTK/VVTK ViewManager always has 1 ViewWindow, so view index is index of view manager
+ if ( viewIndex >= 0 && viewIndex < lst.count() ) {
+ SUIT_ViewManager* vman = lst.at( viewIndex );
+ SUIT_ViewModel* vmodel = vman->getViewModel();
+ // both SVTK and VVTK view models can be casted to SALOME_View
+ displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
+
+ // store displayed actor in a temporary map for quicker access later when restoring other parameters
+ SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
+ QMap<QString, VISU_Actor*> viewActorMap;
+ if ( vtkActors.contains( entry ) )
+ viewActorMap = vtkActors[ entry ];
+ viewActorMap[ viewerTypeIndex ] = getActor( entry, vtkView );
+ vtkActors[ entry ] = viewActorMap;
+ }
+ }
+ else { // the rest properties "work" with VISU_Actor, so we initialize it at first
+ VISU_Actor* vActor = 0;
+ if ( vtkActors.contains( entry ) ) {
+ QMap<QString, VISU_Actor*> viewActorMap = vtkActors[ entry ];
+ if ( viewActorMap.contains( viewerTypeIndex ) )
+ vActor = viewActorMap[ viewerTypeIndex ];
+ }
+ if ( !vActor )
+ continue;
+
+ QString val( (*valuesIt).c_str() );
+
+ if ( paramName == "Name" )
+ vActor->setName( val.latin1() );
+
+ else if ( paramName == "RepresentationMode" )
+ vActor->SetRepresentation( val.toInt() );
+
+ else if ( paramName == "Opacity" )
+ vActor->SetOpacity( val.toFloat() );
+
+ else if ( paramName == "Color" ) {
+ QStringList colors = QStringList::split( gDigitsSep, val );
+ if ( colors.count() == 3 )
+ vActor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() );
+ }
+
+ else if ( paramName == "LineWidth" )
+ vActor->SetLineWidth( val.toFloat() );
+
+ else if ( paramName == "ShrinkMode" ) {
+ vActor->SetShrinkable( true );
+ vActor->SetShrink();
+ }
+
+ else if ( paramName == "ShrunkFactor" )
+ vActor->SetShrinkFactor( val.toFloat() );
+
+ else if ( paramName == "Shading" ) {
+ if ( VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor ) )
+ scalarMapActor->SetShading();
+ }
+
+ else if ( paramName.find( "ClippingPlane" ) != std::string::npos ) {
+ VISU::Prs3d_i* prs = vActor->GetPrs3d();
+ if ( !prs )
+ continue;
+
+ prs->RemoveAllClippingPlanes();
+ if ( val != "Off" ) {
+ QStringList vals = QStringList::split( gDigitsSep, val );
+ if ( vals.count() == 6 ) { // format check: 6 float values
+ vtkFloatingPointType normal[3], origin[3];
+ for (int x = 0; x < 3; x++ ) {
+ normal[x] = vals[x].toFloat();
+ origin[x] = vals[x+3].toFloat();
+ }
+ OrientedPlane* plane = OrientedPlane::New();
+ plane->SetNormal( normal );
+ plane->SetOrigin( origin );
+ prs->AddClippingPlane( plane );
+ plane->Delete();
+ }
+ }
+ }
+ } // else ..
+ } // if SVTK
+
+ else if ( viewerType == SPlot2d_Viewer::Type().latin1() ) {
+
+ if ( paramName == "Visibility" && displayer() ) {
+ QPtrList<SUIT_ViewManager> lst;
+ getApp()->viewManagers( viewerType.c_str(), lst );
+
+ if ( viewIndex >= 0 && viewIndex < lst.count() ) {
+ SUIT_ViewManager* vman = lst.at( viewIndex );
+ SUIT_ViewModel* vmodel = vman->getViewModel();
+ // SVTK and VVTK view models can be casted to SALOME_View
+ displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
+ }
+ }
+
+ } // if SPlot2d
+
+ } // for names/parameters iterator
+ } // for entries iterator
+
+ // [ update all SVTK/VVTK/Plot2D views
+ QPtrList<SUIT_ViewManager> lst;
+ getApp()->viewManagers( lst );
+ for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it ) {
+ SUIT_ViewManager* vman = it.current();
+ SUIT_ViewModel* vmodel = vman->getViewModel();
+ if ( !vmodel )
+ continue;
+ if ( vmodel->getType() == SVTK_Viewer::Type() || // processing SVTK and VVTK viewers
+ vmodel->getType() == VVTK_Viewer::Type() ) { // in the same way
+ SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
+ vtkView->getRenderer()->ResetCameraClippingRange();
+ vtkView->Repaint();
+ }
+ else if ( vmodel->getType() == SPlot2d_Viewer::Type().latin1() ) {
+ Plot2d_ViewWindow* plotView = (Plot2d_ViewWindow*) vman->getActiveView();
+ plotView->getViewFrame()->Repaint();
+ }
+ } // ] end of update views
+
+ // VISU module opens one SVTK viewer in activateModule(). This causes a bug in save-restore visual
+ // parameters: it no SVTK view was saved, we need NOT any SVTK on restore. Here we close one
+ // default SVTK if needed.
+ /*
+ QString openedSvtkViewerStr = ip->getProperty( "VtkViewersCount" ).c_str();
+ int openedSvtkViewer = openedSvtkViewerStr.toInt( &ok );
+ if ( ok && openedSvtkViewer == 0 ) {
+ lst.clear();
+ getApp()->viewManagers( SVTK_Viewer::Type(), lst );
+ if ( lst.count() )
+ lst.at( 0 )->closeAllViews();
+ }
+ */
+
+ // if active Gauss Viewer is set ( != -1) then raise the gauss view window.
+ bool ok;
+ QString activeGaussViewerStr = ip->getProperty( "ActiveGaussViewer" ).c_str();
+ int activeGaussViewer = activeGaussViewerStr.toInt( &ok );
+ if ( ok && activeGaussViewer != -1 ) {
+ lst.clear();
+ getApp()->viewManagers( VVTK_Viewer::Type(), lst );
+ if ( activeGaussViewer >= 0 && activeGaussViewer < lst.count() ) {
+ SUIT_ViewWindow* activeView = lst.at( activeGaussViewer )->getActiveView();
+ if ( activeView ) {
+ activeView->setActiveWindow();
+ activeView->setFocus();
+ }
+ }
+ }
+}
+
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : VisuGUI_Module.h
// Author :
// Module : VISU
-// $Header$
#ifndef VisuGUI_Module_HeaderFile
#define VisuGUI_Module_HeaderFile
#include "MED_SharedPtr.hxx"
-namespace VISU
-{
- class Viewer;
- typedef MED::SharedPtr<Viewer> PViewer;
-
- typedef std::map<SUIT_ViewManager*,PViewer> TViewerMap;
-}
-
//! This class inherits base VisuGUI.
/*! Used to display, erase end edit presentations in the VVTK viewer. */
class VisuGUI_Module: public VisuGUI
{
Q_OBJECT;
- friend class VISU::Viewer;
-
public:
VisuGUI_Module();
getViewManager(const QString& theType,
const bool theIsCreate);
+ virtual
+ void
+ storeVisualParameters(int savePoint);
+
+ virtual
+ void
+ restoreVisualParameters(int savePoint);
+
public slots:
//! Reimplemented method of the module deactivation.
virtual
SUIT_ViewManager*
onCreateViewManager();
- void
- onLastViewClosed(SUIT_ViewManager*);
-
void
OnCreateGaussPoints();
void
OnEditGaussPoints();
- //! Reimplemented method of the Gauss Points displaying.
- virtual
- void
- OnDisplayPrs();
-
- //! Reimplemented method of the Gauss Points displaying only.
- virtual
- void
- OnDisplayOnlyPrs();
-
- //! Reimplemented method of the Gauss Points full erasing.
- virtual
- void
- OnEraseAll();
-
- //! Reimplemented method of the Gauss Points erasing.
- virtual
- void
- OnErasePrs();
-
//! Virtual method of saving configuration.
virtual
void
OnRestoreConfiguration();
protected:
- VISU::TViewerMap myViewerMap;
_PTR(SObject) myConfigSObject;
void setProperty( SVTK_ViewWindow*, const QString& ); // set a property (speed_increment, etc ) for SVTK ViewWindow
-// SALOME VisuGUI : implementation of desktop and GUI kernel
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VisuGUI_NameDlg.cxx
// Author : Vadim SANDLER
// $Header$
#include "VisuGUI_NameDlg.h"
+#include "VisuGUI.h"
#include <SUIT_Session.h>
#include <SUIT_Application.h>
#include <SUIT_Desktop.h>
#include <SUIT_Tools.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
+
+#include <LightApp_Application.h>
#include <qgroupbox.h>
#include <qlabel.h>
myButtonCancel->setText( tr( "BUT_CANCEL" ) );
myButtonCancel->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( myButtonCancel );
+
+ myButtonHelp = new QPushButton( GroupButtons, "buttonHelp" );
+ myButtonHelp->setText( tr( "BUT_HELP" ) );
+ myButtonHelp->setAutoDefault( TRUE );
+ GroupButtonsLayout->addWidget( myButtonHelp );
/***************************************************************/
topLayout->addWidget( GroupC1 );
// signals and slots connections
connect( myButtonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( myButtonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ connect( myButtonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
/* Move widget on the botton right corner of main widget */
SUIT_Tools::centerWidget( this, parent );
QDialog::accept();
}
+void VisuGUI_NameDlg::onHelp()
+{
+ QString aHelpFileName = "/files/renaming_presentations.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+ app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ }
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
+
/*!
Creates modal <Rename> dialog and returns name entered [ static ]
*/
-// SALOME VisuGUI : implementation of desktop and GUI kernel
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VisuGUI_NameDlg.h
// Author : Vadim SANDLER
// Module : SALOME
-// $Header$
#ifndef VisuGUI_NAMEDLG_H
#define VisuGUI_NAMEDLG_H
protected slots:
void accept();
+ void onHelp();
private:
QPushButton* myButtonOk;
QPushButton* myButtonCancel;
+ QPushButton* myButtonHelp;
QLineEdit* myLineEdit;
};
// 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.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "VisuGUI_OffsetDlg.h"
#include "VISU_ViewManager_i.hh"
#include "VISU_Actor.h"
+#include "LightApp_Application.h"
#include "SalomeApp_Application.h"
#include "SVTK_ViewWindow.h"
#include "SVTK_ViewModel.h"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
#include "QtxDblSpinBox.h"
TopLayout->setSpacing(6);
TopLayout->setMargin(11);
- QHBox* aOffsetsPane = new QHBox (this);
- aOffsetsPane->setSpacing(6);
+ QHBox* anOffsetsPane = new QHBox (this);
+ anOffsetsPane->setSpacing(6);
- new QLabel ("dX:", aOffsetsPane);
- myDxEdt = new QtxDblSpinBox (aOffsetsPane, "myDxEdt");
+ new QLabel ("dX:", anOffsetsPane);
+ myDxEdt = new QtxDblSpinBox (anOffsetsPane, "myDxEdt");
myDxEdt->setRange(-MAXVAL, MAXVAL);
- new QLabel("dY:", aOffsetsPane);
- myDyEdt = new QtxDblSpinBox (aOffsetsPane, "myDyEdt");
+ new QLabel("dY:", anOffsetsPane);
+ myDyEdt = new QtxDblSpinBox (anOffsetsPane, "myDyEdt");
myDyEdt->setRange(-MAXVAL, MAXVAL);
- new QLabel("dZ:", aOffsetsPane);
- myDzEdt = new QtxDblSpinBox (aOffsetsPane, "myDzEdt");
+ new QLabel("dZ:", anOffsetsPane);
+ myDzEdt = new QtxDblSpinBox (anOffsetsPane, "myDzEdt");
myDzEdt->setRange(-MAXVAL, MAXVAL);
- QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), aOffsetsPane);
+ QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), anOffsetsPane);
connect(aResetBtn, SIGNAL(clicked()), this, SLOT(onReset()));
- TopLayout->addWidget(aOffsetsPane);
+ TopLayout->addWidget(anOffsetsPane);
if (!VISU::GetCStudy(VISU::GetAppStudy(theModule))->GetProperties()->IsLocked()) {
mySaveChk = new QCheckBox ("Save to presentation", this);
QPushButton* buttonCancel = new QPushButton(tr("&Cancel") , GroupButtons, "buttonCancel");
buttonCancel->setAutoDefault(TRUE);
GroupButtonsLayout->addWidget(buttonCancel, 0, 4);
+ GroupButtonsLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 5);
+
+ QPushButton* buttonHelp = new QPushButton(tr("&Help") , GroupButtons, "buttonHelp");
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 6);
TopLayout->addWidget(GroupButtons);
connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(onApply()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
}
void VisuGUI_OffsetDlg::addPresentation (VISU::Prs3d_i* thePrs)
{
myPrsList.append(thePrs);
- OffsetStruct aOffs;
- thePrs->GetOffset(aOffs.myOffset);
- myOldOffsets.append(aOffs);
+ CORBA::Float anOffset[3];
+ thePrs->GetOffset(anOffset[0],anOffset[1],anOffset[2]);
+ OffsetStruct anOffs(anOffset[0],anOffset[1],anOffset[2]);
+ myOldOffsets.append(anOffs);
if (myPrsList.count() == 1) {
- setOffset(aOffs.myOffset);
+ setOffset(anOffs.myOffset);
} else if (myPrsList.count() == 2) {
- float aOffset[3];
- aOffset[0] = aOffset[1] = aOffset[2] = 0;
- setOffset(aOffset);
+ OffsetStruct anOffs;
+ setOffset(anOffs.myOffset);
}
}
-void VisuGUI_OffsetDlg::setOffset (const float* theOffset)
+void VisuGUI_OffsetDlg::setOffset (const vtkFloatingPointType* theOffset)
{
myDxEdt->setValue(theOffset[0]);
myDyEdt->setValue(theOffset[1]);
myDzEdt->setValue(theOffset[2]);
}
-void VisuGUI_OffsetDlg::getOffset (float* theOffset) const
+void VisuGUI_OffsetDlg::getOffset (vtkFloatingPointType* theOffset) const
{
theOffset[0] = myDxEdt->value();
theOffset[1] = myDyEdt->value();
return false;
}
-void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, float* theOffset)
+void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointType* theOffset)
{
if (myPrsList.count() == 0) return;
- if (isToSave()) thePrs->SetOffset(theOffset);
+ if (isToSave()) thePrs->SetOffset(theOffset[0],theOffset[1],theOffset[2]);
ViewManagerList aViewManagerList;
SalomeApp_Application* anApp = myModule->getApp();
void VisuGUI_OffsetDlg::accept()
{
- float aOffset[3];
- getOffset(aOffset);
+ vtkFloatingPointType anOffset[3];
+ getOffset(anOffset);
for (int i = 0; i < myPrsList.count(); i++) {
- updateOffset(myPrsList.at(i), aOffset);
+ updateOffset(myPrsList.at(i), anOffset);
}
QDialog::accept();
}
void VisuGUI_OffsetDlg::onApply()
{
- float aOffset[3];
- getOffset(aOffset);
+ vtkFloatingPointType anOffset[3];
+ getOffset(anOffset);
for (int i = 0; i < myPrsList.count(); i++) {
- updateOffset(myPrsList.at(i), aOffset);
+ updateOffset(myPrsList.at(i), anOffset);
+ }
+}
+
+void VisuGUI_OffsetDlg::onHelp()
+{
+ QString aHelpFileName = "/files/scaling_presentations.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName);
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
}
}
// 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.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef DIALOGBOX_OFFSET_H
#define DIALOGBOX_OFFSET_H
+#include "VTKViewer.h"
#include "VISU_Prs3d_i.hh"
// QT Includes
class QtxDblSpinBox;
class VisuGUI;
-struct OffsetStruct {
- float myOffset[3];
+struct OffsetStruct
+{
+ vtkFloatingPointType myOffset[3];
+
+ OffsetStruct()
+ {
+ myOffset[0] = myOffset[1] = myOffset[2] = 0;
+ }
+
+ OffsetStruct(vtkFloatingPointType theX,
+ vtkFloatingPointType theY,
+ vtkFloatingPointType theZ)
+ {
+ myOffset[0] = theX;
+ myOffset[1] = theY;
+ myOffset[2] = theZ;
+ }
};
class VisuGUI_OffsetDlg: public QDialog
void addPresentation (VISU::Prs3d_i* thePrs);
int getPrsCount() const { return myPrsList.count(); }
- void setOffset (const float* theOffset);
- void getOffset (float* theOffset) const;
+ void setOffset (const vtkFloatingPointType* theOffset);
+ void getOffset (vtkFloatingPointType* theOffset) const;
bool isToSave() const;
public slots:
virtual void accept();
virtual void reject();
void onApply();
+ void onHelp();
private:
- void updateOffset (VISU::Prs3d_i* thePrs, float* theOffset);
+ void updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointType* theOffset);
VisuGUI * myModule;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
#include "VISU_ViewManager_i.hh"
#include "VISU_Plot3DPL.hxx"
-#include "SALOME_Actor.h"
#include "SVTK_ViewWindow.h"
+
+#include "SALOME_Actor.h"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
+#include "LightApp_Application.h"
#include <qlayout.h>
#include <qvalidator.h>
//=======================================================================
class TPlane : public SALOME_Actor
{
- float mySize;
+ vtkFloatingPointType mySize;
vtkDataSetMapper* myMapper;
vtkPlaneSource* myPlaneSource;
public:
// constructor
- TPlane(float planeSize): mySize(planeSize)
+ TPlane(vtkFloatingPointType planeSize): mySize(planeSize)
{
Init();
}
// set plane parameters
- void Set(float origin[3], float normal[3])
+ void Set(vtkFloatingPointType origin[3], vtkFloatingPointType normal[3])
{
- float point2[3], point1[3];
+ vtkFloatingPointType point2[3], point1[3];
vtkMath::Perpendiculars(normal, point1, point2, 0.);
for (int i = 0; i < 3; ++i) {
point1[ i ] = point1[ i ] * mySize + origin[ i ];
//=======================================================================
VisuGUI_Plot3DPane::VisuGUI_Plot3DPane (QWidget* parent)
: QVBox(parent), myInitFromPrs(false), myPreviewActor(NULL),
- myViewWindow(VISU::GetViewWindow()), myPrs(NULL), myPipeCopy(NULL)
+ myViewWindow(VISU::GetActiveViewWindow<SVTK_ViewWindow>()), myPrs(NULL), myPipeCopy(NULL)
{
layout()->setAlignment(Qt::AlignTop);
setSpacing(6);
void VisuGUI_Plot3DPane::onPositionSpn()
{
if (myPrs && !RelativeChkB->isChecked()) {
- float minPos, maxPos;
+ vtkFloatingPointType minPos, maxPos;
storePrsParams();
myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos);
restorePrsParams();
//=======================================================================
void VisuGUI_Plot3DPane::onRelativePos(bool isRelativePos)
{
- float minPos = 0., maxPos = 1., pos = PositionSpn->value();
+ vtkFloatingPointType minPos = 0., maxPos = 1., pos = PositionSpn->value();
if (myPrs) {
storePrsParams();
myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos);
}
// set plane parameters corresponding to control values
storePrsParams();
- float normal[3], origin[3];
+ vtkFloatingPointType normal[3], origin[3];
myPrs->GetPlot3DPL()->GetBasePlane(origin, normal, true);
planePreview->Set(origin, normal);
restorePrsParams();
return true;
}
+void VisuGUI_Plot3DPane::setPlane(int theOrientation, double theXRotation, double theYRotation, double thePlanePos)
+{
+ // Set plane
+ int id;
+ switch (theOrientation) {
+ case VISU::Plot3D::XY: id = 0; break;
+ case VISU::Plot3D::YZ: id = 1; break;
+ default: id = 2;
+ }
+ GBOrientation->setButton(id);
+ orientationChanged(id);
+ GBOrientation->setEnabled(false);
+
+
+ // Set rotation
+ Rot1->setValue(theXRotation * 180./PI);
+ Rot1->setEnabled(false);
+ Rot2->setValue(theYRotation * 180./PI);
+ Rot2->setEnabled(false);
+
+ // Set position
+ RelativeChkB->setChecked(false);
+ onRelativePos(false); // update range
+ PositionSpn->setValue(thePlanePos);
+ RelativeChkB->setEnabled(false);
+ PositionSpn->setEnabled(false);
+}
+
+
//=======================================================================
//function : Constructor
//purpose :
QPushButton* buttonCancel = new QPushButton (tr("&Cancel") , GroupButtons, "buttonCancel");
buttonCancel->setAutoDefault(TRUE);
GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
+ QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp");
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
TopLayout->addWidget(GroupButtons);
// signals and slots connections
connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
}
//=======================================================================
QDialog::reject();
}
+
+//=======================================================================
+//function : onHelp
+//purpose :
+//=======================================================================
+void VisuGUI_Plot3DDlg::onHelp()
+{
+ QString aHelpFileName = "plot_3d_presentation.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+ app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ }
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
+
+//=======================================================================
+//function : setPlane
+//purpose :
+//=======================================================================
+void VisuGUI_Plot3DDlg::setPlane(int theOrientation, double theXRotation, double theYRotation, double thePlanePos)
+{
+ myIsoPane->setPlane(theOrientation, theXRotation, theYRotation, thePlanePos);
+}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
VISU::Plot3D_i* GetPrs() { return myPrs; }
+ void setPlane(int theOrientation, double theXRotation, double theYRotation, double thePlanePos);
+
private:
bool myInitFromPrs;
SALOME_Actor* myPreviewActor;
int storeToPrsObject (VISU::Plot3D_i* thePrs)
{ return myScalarPane->storeToPrsObject(thePrs) && myIsoPane->storeToPrsObject(thePrs); }
+ void setPlane(int theOrientation, double theXRotation, double theYRotation, double thePlanePos);
+
protected slots:
void accept();
void reject();
+ void onHelp();
private:
VisuGUI_Plot3DPane* myIsoPane;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// Module : VISU
#include "VisuGUI_PopupTools.h"
+
#include "VisuGUI_ViewTools.h"
#include "VisuGUI_Tools.h"
-#include "SalomeApp_Study.h"
-#include "LightApp_Study.h"
+
+#include "VISU_Result_i.hh"
+#include "VISU_Gen_i.hh"
#include "VISU_Actor.h"
#include "VISU_ScalarMapAct.h"
-#include "VISU_Result_i.hh"
+
#include "SalomeApp_Study.h"
+#include "LightApp_Study.h"
using namespace VISU;
else if ( p == "hasActor" ) val = QtxValue( hasActor( ind ) );
else if ( p == "isShading" ) val = QtxValue( isShading( ind ) );
else if ( p == "isScalarMapAct" ) val = QtxValue( isScalarMapAct( ind ) );
+ else if ( p == "isVisuComponent") val = QtxValue( isVisuComponent( ind ) );
}
return val;
QString VisuGUI_Selection::medSource( const int ind ) const
{
_PTR(Study) aStudyDS = GetStudy()->studyDS();
- if(_PTR(SObject) aSObject = aStudyDS->FindObjectID(entry(ind))){
+ if(_PTR(SObject) aSObject = aStudyDS->FindObjectID(entry(ind).latin1())){
VISU::Result_var aRes;
if(VISU::Result_i* aResult = CheckResult(myModule,aSObject,aRes)){
using namespace VISU;
{
QString aResStr;
- if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) ){
- if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) ){
+ if (SVTK_ViewWindow* aView = GetActiveViewWindow<SVTK_ViewWindow>(myModule)) {
+ if (VISU_Actor* anVISUActor = FindActor(aView, entry(ind).latin1())) {
int aRepresent = anVISUActor->GetRepresentation();
- switch ( aRepresent ){
+ switch (aRepresent) {
ENUM2STRING( aResStr, VISU::POINT );
ENUM2STRING( aResStr, VISU::WIREFRAME );
ENUM2STRING( aResStr, VISU::SHADED );
const QString& theEntry)
{
typedef typename TViewer::TViewWindow TViewWindow;
- if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule))
- if(VISU_Actor* anActor = FindActor(aViewWindow,theEntry.latin1()))
+ if (TViewWindow* aViewWindow = GetActiveViewWindow<TViewWindow>(theModule))
+ if (VISU_Actor* anActor = FindActor(aViewWindow,theEntry.latin1()))
return anActor->GetVisibility() ? "true" : "false";
return QString();
{
QString aResStr;
- if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) )
+ if ( SVTK_ViewWindow* aView = GetActiveViewWindow<SVTK_ViewWindow>(myModule) )
if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) )
if ( anVISUActor->IsShrunkable() )
aResStr = anVISUActor->IsShrunk() ? "1" : "0";
{
QString aResStr;
- if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) )
+ if ( SVTK_ViewWindow* aView = GetActiveViewWindow<SVTK_ViewWindow>(myModule) )
if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) )
if ( VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(anVISUActor) )
aResStr = anActor->IsShading() ? "1" : "0";
{
QString aResStr;
- if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) )
+ if ( SVTK_ViewWindow* aView = GetActiveViewWindow<SVTK_ViewWindow>(myModule) )
if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) )
- {
- VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(anVISUActor);
- aResStr = anActor ? "1" : "0";
- }
-
+ {
+ VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(anVISUActor);
+ aResStr = anActor ? "1" : "0";
+ }
+
return aResStr;
}
+
+bool VisuGUI_Selection::isVisuComponent( const int ind ) const
+{
+ SalomeApp_Study* study = GetStudy();
+ if ( !study )
+ return false;
+
+ _PTR(SObject) obj = study->studyDS()->FindObjectID( entry( ind ).latin1() );
+ if ( !obj )
+ return false;
+ CORBA::Object_var anObj = VISU::ClientSObjectToObject( obj );
+ if( CORBA::is_nil( anObj ) )
+ return false;
+
+ return dynamic_cast<VISU::VISU_Gen_i*>( VISU::GetServant( anObj ).in() );
+}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
QString hasActor( const int ) const;
QString isShading( const int ) const;
QString isScalarMapAct( const int ) const;
+ bool isVisuComponent( const int ) const;
private:
int nbChild( const int, const bool ) const;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : VisuGUI_Module.h
// Author :
// Module : VISU
-// $Header$
#ifndef VisuGUI_Prs3dTools_HeaderFile
#define VisuGUI_Prs3dTools_HeaderFile
template<class TPrs3d_i, class TViewer, class TDlg, int TIsDlgModal>
void
EditPrs3d(VisuGUI* theModule,
- VISU::Prs3d_i* thePrs3d)
+ VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow)
{
- if(TPrs3d_i* aPrs3d = dynamic_cast<TPrs3d_i*>(thePrs3d)){
+ if (TPrs3d_i* aPrs3d = dynamic_cast<TPrs3d_i*>(thePrs3d)) {
TDlg* aDlg = new TDlg (theModule);
aDlg->initFromPrsObject(aPrs3d);
if (runAndWait(aDlg,TIsDlgModal)) {
try {
aPrs3d->UpdateActors();
} catch (std::runtime_error& exc) {
+ aPrs3d->RemoveActors();
+
INFOS(exc.what());
SUIT_MessageBox::warn1
(GetDesktop(theModule), QObject::tr("WRN_VISU"),
QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()),
QObject::tr("BUT_OK"));
-
- aPrs3d->RemoveActors();
}
- typedef typename TViewer::TViewWindow TViewWindow;
- if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule)){
- aViewWindow->getRenderer()->ResetCameraClippingRange();
- aViewWindow->Repaint();
+ if (theViewWindow) {
+ theViewWindow->getRenderer()->ResetCameraClippingRange();
+ theViewWindow->Repaint();
}
// Optionally, create table and curves for cut lines
QApplication::setOverrideCursor(Qt::waitCursor);
template<class TPrs3d_i, class TDlg, int TIsDlgModal>
inline
void
- EditPrs3d(VisuGUI* theModule,
- VISU::Prs3d_i* thePrs3d)
+ EditPrs3d(VisuGUI* theModule,
+ Handle(SALOME_InteractiveObject)& theIO,
+ VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow = NULL)
{
- EditPrs3d<TPrs3d_i,SVTK_Viewer,TDlg,TIsDlgModal>(theModule,thePrs3d);
+ SVTK_ViewWindow* aViewWindow = theViewWindow;
+ if (!aViewWindow)
+ // Create SVTK_ViewWindow, if it does not exist
+ aViewWindow = GetViewWindow<SVTK_Viewer>(theModule);
+ if (aViewWindow) {
+ EditPrs3d<TPrs3d_i,SVTK_Viewer,TDlg,TIsDlgModal>(theModule, thePrs3d, aViewWindow);
+ aViewWindow->highlight(theIO, 1);
+ }
}
//---------------------------------------------------------------
bool
CreatePrs3d(VisuGUI* theModule,
_PTR(SObject) theTimeStamp,
- const Handle(SALOME_InteractiveObject)& theIO,
- const bool theIsCreateView = false)
+ const Handle(SALOME_InteractiveObject)& theIO)
{
Storable::TRestoringMap aMap = getMapOfValue(theTimeStamp);
bool isExist;
QString aType = Storable::FindValue(aMap,"myType",&isExist);
- if(!isExist || aType.toInt() != TTIMESTAMP )
+ if (!isExist || aType.toInt() != TTIMESTAMP )
return false;
QString aMeshName = Storable::FindValue(aMap,"myMeshName",&isExist).latin1();
QString anEntity = Storable::FindValue(aMap,"myEntityId",&isExist).latin1();
QString aFieldName = Storable::FindValue(aMap,"myFieldName",&isExist).latin1();
QString aTimeStampId = Storable::FindValue(aMap,"myTimeStampId",&isExist).latin1();
- //
- int aPos = GetFreePositionOfDefaultScalarBar(theModule);
- GetResourceMgr()->setValue("VISU","scalar_bar_position_num",aPos);
- //
+
+ // Create new TViewWindow instance, if it does not exist.
+ typedef typename TViewer::TViewWindow TViewWindow;
+ TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule);
+
+ // Define free position for scalar bar.
+ int aPos = GetFreePositionOfDefaultScalarBar(theModule, aViewWindow);
+ GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos);
+
QApplication::setOverrideCursor(Qt::waitCursor);
-
+
TPrs3d_i* aPrs3d =
CreatePrs3d<TPrs3d_i>(theModule,
theTimeStamp,
(Entity)anEntity.toInt(),
aFieldName.latin1(),
aTimeStampId.toInt());
-
+
QApplication::restoreOverrideCursor();
- if(aPrs3d){
+ if (aPrs3d) {
SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
- if(!aValue){
- if(TDlg* aDlg = new TDlg(theModule)){ // dialog box in creation mode
+ if (!aValue) {
+ if (TDlg* aDlg = new TDlg(theModule)) { // dialog box in creation mode
aDlg->initFromPrsObject(aPrs3d);
- if(runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) {
+ if (runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) {
// Optionally, create table and curves for cut lines
QApplication::setOverrideCursor(Qt::waitCursor);
CreateCurves( theModule,
}
}
}
- PublishInView<TViewer>(theModule,aPrs3d,true,theIsCreateView);
- AddScalarBarPosition(theModule,aPrs3d,aPos);
+ // Display created presentation.
+ if (aViewWindow) {
+ PublishInView(theModule, aPrs3d, aViewWindow, /*highlight = */true);
+ aViewWindow->onFitAll();
+
+ AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos);
+ }
return true;
}
return false;
}
-
+
//---------------------------------------------------------------
template<class TPrs3d_i, class TViewer, class TDlg, int IsDlgModal>
inline
void
- CreatePrs3d(VisuGUI* theModule,
- const bool theIsCreateView = true)
+ CreatePrs3d(VisuGUI* theModule)
{
if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule)))
return;
-
+
_PTR(SObject) aTimeStampSObj;
Handle(SALOME_InteractiveObject) anIO;
- if(!CheckTimeStamp(theModule,aTimeStampSObj,&anIO))
+ if (!CheckTimeStamp(theModule,aTimeStampSObj,&anIO))
+ return;
+
+ // Create new TViewWindow instance, if it does not exist.
+ typedef typename TViewer::TViewWindow TViewWindow;
+ if (!GetViewWindow<TViewer>(theModule))
return;
-
- if(!CreatePrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>(theModule,aTimeStampSObj,anIO,theIsCreateView))
+
+ if (!CreatePrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>(theModule,aTimeStampSObj,anIO))
return;
-
+
theModule->application()->putInfo(QObject::tr("INF_DONE"));
-
- typedef typename TViewer::TViewWindow TView;
- if(TView* aView = GetViewWindow<TViewer>(theModule,theIsCreateView))
- aView->onFitAll();
}
template<class TPrs3d_i, class TDlg, int IsDlgModal>
inline
void
- CreatePrs3d(VisuGUI* theModule,
- const bool theIsCreateView = true)
+ CreatePrs3d(VisuGUI* theModule)
{
- if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){
- QString aType = aViewManager->getType();
- if(aType == SVTK_Viewer::Type())
- CreatePrs3d<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>(theModule,theIsCreateView);
- else if(aType == VVTK_Viewer::Type())
- CreatePrs3d<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>(theModule,theIsCreateView);
- }
- }
+ if (SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager())
+ if (aViewManager->getType() == VVTK_Viewer::Type())
+ return CreatePrs3d<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>(theModule);
+ CreatePrs3d<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>(theModule);
+ }
}
#endif
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
-
-#include "SVTK_FontWidget.h"
-
-#include "SVTK_ViewWindow.h"
+#include "VisuGUI_ViewTools.h"
#include "SVTK_ViewWindow.h"
+#include "SVTK_FontWidget.h"
#include "VISUConfig.hh"
#include "VISU_Convertor.hxx"
#include "VISU_ScalarMap_i.hh"
#include "VISU_ScalarMapAct.h"
-#include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
+#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
#include "SUIT_ResourceMgr.h"
VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane (QWidget * parent, bool SetPref):
QVBox(parent), myPreviewActor(0)
{
- myVerX = 0.01; myVerY = 0.10; myVerW = 0.10; myVerH = 0.80;
- myHorX = 0.20; myHorY = 0.01; myHorW = 0.60; myHorH = 0.12;
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ QString propertyName;
+ propertyName = QString("scalar_bar_vertical_");
+ myVerX = aResourceMgr->doubleValue("VISU", propertyName + "x", 0.);
+ myVerY = aResourceMgr->doubleValue("VISU", propertyName + "y", 0.);
+ myVerW = aResourceMgr->doubleValue("VISU", propertyName + "width", 0.);
+ myVerH = aResourceMgr->doubleValue("VISU", propertyName + "height",0.);
+
+ propertyName = QString("scalar_bar_horizontal_");
+ myHorX = aResourceMgr->doubleValue("VISU", propertyName + "x", 0.);
+ myHorY = aResourceMgr->doubleValue("VISU", propertyName + "y", 0.);
+ myHorW = aResourceMgr->doubleValue("VISU", propertyName + "width", 0.);
+ myHorH = aResourceMgr->doubleValue("VISU", propertyName + "height",0.);
+
Imin = 0.0; Imax = 0.0; /*Fmin = 0.0; Fmax = 0.0;*/ Rmin = 0.0; Rmax = 0.0;
myRangeMode = -1;
void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) {
initFromResources();
myScalarMap = thePrs;
+ myTitle = thePrs->GetTitle();
setPosAndSize( thePrs->GetPosX(),
thePrs->GetPosY(),
thePrs->GetWidth(),
default:
setLogarithmic(false);
}
- float aRange[2];
+ vtkFloatingPointType aRange[2];
thePrs->GetScalarMapPL()->GetSourceRange(aRange);
Rmin = aRange[0]; Rmax = aRange[1];
setRange( thePrs->GetMin(), thePrs->GetMax(),
const VISU::TNames& aCompNames = aField->myCompNames;
const VISU::TNames& aUnitNames = aField->myUnitNames;
for(int i = 0; i < aNbComp; i++){
- QString aComponent = QString(aCompNames[i]).simplifyWhiteSpace();
+ QString aComponent = QString(aCompNames[i].c_str()).simplifyWhiteSpace();
if(aComponent.isNull() || aComponent == "")
aComponent = "Component " + QString::number(i+1);
else
aComponent = "[" + QString::number(i+1) + "] " + aComponent;
- QString anUnit = QString(aUnitNames[i]).simplifyWhiteSpace();
+ QString anUnit = QString(aUnitNames[i].c_str()).simplifyWhiteSpace();
if(anUnit.isNull() || anUnit == "")
anUnit = "-";
// "Title"
myTextDlg->setTitleText(QString(thePrs->GetTitle()));
- float R, G, B;
+ vtkFloatingPointType R, G, B;
thePrs->GetTitleColor(&R, &G, &B);
myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)),
void VisuGUI_ScalarBarPane::updatePreview()
{
if (myPreviewCheck->isChecked()) {
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
deleteScalarBar();
createScalarBar();
vf->Repaint();
*/
void VisuGUI_ScalarBarPane::createScalarBar()
{
- if (VISU::GetViewWindow() == NULL) return;
+ if (VISU::GetActiveViewWindow<SVTK_ViewWindow>() == NULL) return;
if (myPreviewActor != 0) return;
if (myScalarMap == NULL) return;
- if(!check()) return;
-
+ if (!check()) return;
+ myScalarMapPL = VISU_ScalarMapPL::New();
+ if(myScalarMap->GetScalarMapPL())
+ myScalarMapPL->ShallowCopy(myScalarMap->GetScalarMapPL());
+
if ( myBusy ) return;
myBusy = true;
myPreviewActor->GetScalarBar()->VisibilityOn();
myPreviewActor->PickableOff();
- myScalarMap->SetScalarMode(myModeCombo->currentItem());
- myScalarMap->SetPosition(getX(),getY());
- myScalarMap->SetSize(getWidth(),getHeight());
- myScalarMap->SetBarOrientation((RBvert->isChecked())? VISU::ScalarMap::VERTICAL : VISU::ScalarMap::HORIZONTAL);
+ myScalarMapPL->SetScalarMode(myModeCombo->currentItem());
if(isLogarithmic())
- myScalarMap->SetScaling(VISU::LOGARITHMIC);
+ myScalarMapPL->SetScaling(VISU::LOGARITHMIC);
else
- myScalarMap->SetScaling(VISU::LINEAR);
- if (RBFrange->isChecked()) {
- myScalarMap->SetSourceRange();
- } else {
- myScalarMap->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble());
- }
- myScalarMap->SetNbColors(sbCol);
- myScalarMap->SetLabels(sbLab);
+ myScalarMapPL->SetScaling(VISU::LINEAR);
+ vtkFloatingPointType theRange[2];
+ theRange[0] = (vtkFloatingPointType)MinEdit->text().toDouble();
+ theRange[1] = (vtkFloatingPointType)MaxEdit->text().toDouble();
+ myScalarMapPL->SetScalarRange(theRange);
+ myScalarMapPL->SetNbColors(sbCol);
- myScalarMap->GetScalarMapPL()->SetNbColors(sbCol);
- myScalarMap->GetScalarMapPL()->Update();
-
- aScalarBarActor->SetLookupTable(myScalarMap->GetScalarMapPL()->GetBarTable());
+ myScalarMapPL->Update();
+
+ aScalarBarActor->SetLookupTable(myScalarMapPL->GetBarTable());
if (myTextDlg->getTitleText().latin1() != "")
aScalarBarActor->SetTitle(myTextDlg->getTitleText().latin1());
else
- aScalarBarActor->SetTitle(myScalarMap->GetTitle());
+ aScalarBarActor->SetTitle(myTitle.c_str());
aScalarBarActor->SetOrientation(getOrientation());
aScalarBarActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
aScalarBarActor->GetPositionCoordinate()->SetValue(getX(),getY());
isTitleBold,isTitleItalic,isTitleShadow);
vtkTextProperty* aTitleProp = aScalarBarActor->GetTitleTextProperty();
aTitleProp->SetFontFamily(aTitleFontFamily);
- aTitleProp->SetColor(float(aTitleColor.red())/255.,
- float(aTitleColor.green())/255.,
- float(aTitleColor.blue())/255.);
+ aTitleProp->SetColor(vtkFloatingPointType(aTitleColor.red())/255.,
+ vtkFloatingPointType(aTitleColor.green())/255.,
+ vtkFloatingPointType(aTitleColor.blue())/255.);
(isTitleBold)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
(isTitleItalic)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
(isTitleShadow)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
isLabelBold, isLabelItalic, isLabelShadow);
vtkTextProperty* aLabelProp = aScalarBarActor->GetLabelTextProperty();
aLabelProp->SetFontFamily(aLabelFontFamily);
- aLabelProp->SetColor(float(aLabelColor.red())/255.,
- float(aLabelColor.green())/255.,
- float(aLabelColor.blue())/255.);
+ aLabelProp->SetColor(vtkFloatingPointType(aLabelColor.red())/255.,
+ vtkFloatingPointType(aLabelColor.green())/255.,
+ vtkFloatingPointType(aLabelColor.blue())/255.);
(isLabelBold)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
(isLabelItalic)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
(isLabelShadow)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
aScalarBarActor->Modified();
- VISU::GetViewWindow()->AddActor(myPreviewActor);
+ VISU::GetActiveViewWindow<SVTK_ViewWindow>()->AddActor(myPreviewActor);
myBusy = false;
}
if ( myBusy ) return;
if (myPreviewActor == 0) return;
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()){
- vf->RemoveActor(myPreviewActor);
- myPreviewActor->GetScalarBar()->VisibilityOff();
- }
+ vtkRenderer* aRend = myPreviewActor->GetRenderer();
+ if(aRend)
+ myPreviewActor->RemoveFromRender(aRend);
+ myPreviewActor->GetScalarBar()->VisibilityOff();
myPreviewActor->Delete();
myPreviewActor = 0;
+
+ if (myScalarMapPL){
+ myScalarMapPL->Delete();
+ myScalarMapPL = 0;
+ }
}
/*! public: Deleting preview scalar bar
*/
void VisuGUI_ScalarBarPane::deletePreview()
{
deleteScalarBar();
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
+ vf->Repaint();
}
/**
* Store values to presentation object
thePrs->SetLabelColor(aLblColor.red()/255.,
aLblColor.green()/255.,
aLblColor.blue()/255.);
+ myIsStoreTextProp = false;
}
return 1;
{
if ( myScalarMap ) {
if ( RBFrange->isChecked() ) {
- float aRange[2];
+ vtkFloatingPointType aRange[2];
+ int aMode = myScalarMap->GetScalarMode();
myScalarMap->SetScalarMode(theMode);
myScalarMap->GetScalarMapPL()->GetSourceRange(aRange);
MinEdit->setText( QString::number( aRange[0] ) );
MaxEdit->setText( QString::number( aRange[1] ) );
+ myScalarMap->SetScalarMode(aMode);
}
}
+ updatePreview();
}
/*!
void VisuGUI_ScalarBarPane::onTextPref()
{
- myIsStoreTextProp = myTextDlg->exec();
+ myTextDlg->storeBeginValues();
+ myIsStoreTextProp = myTextDlg->exec() || myIsStoreTextProp;
updatePreview();
}
void VisuGUI_ScalarBarPane::onPreviewCheck (bool thePreview)
{
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
if (thePreview) {
createScalarBar();
} else {
buttonCancel->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
+ QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" );
+ buttonHelp->setAutoDefault( TRUE );
+ GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
+
TopLayout->addWidget( GroupButtons );
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
}
/*!
QDialog::reject();
}
+/*!
+ Called when <Help> button is clicked, shows the corresponding help page in defined browser
+*/
+void VisuGUI_ScalarBarDlg::onHelp()
+{
+ QString aHelpFileName = "/files/scalar_map_presentation.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+ app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ }
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
+
//#######################################################################################
VisuGUI_TextPrefDlg::VisuGUI_TextPrefDlg (QWidget* parent)
buttonCancel->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
+ QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" );
+ buttonHelp->setAutoDefault( TRUE );
+ GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
+
TopLayout->addWidget( GroupButtons );
connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
+}
+
+void VisuGUI_TextPrefDlg::onHelp()
+{
+ QString aHelpFileName = "/files/scalar_map_presentation.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+ app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ }
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
+
+void VisuGUI_TextPrefDlg::storeBeginValues()
+{
+ myTitle = myTitleEdt->text();
+ myTitleFont->GetData(myColors[0], myComboVals[0], myCheckVals[0], myCheckVals[1], myCheckVals[2]);
+ myLabelFont->GetData(myColors[1], myComboVals[1], myCheckVals[3], myCheckVals[4], myCheckVals[5]);
+}
+
+/*!
+ Called when <Cancel> button is clicked, restore begin values
+*/
+void VisuGUI_TextPrefDlg::reject()
+{
+ myTitleEdt->setText(myTitle);
+ myTitleFont->SetData(myColors[0], myComboVals[0], myCheckVals[0], myCheckVals[1], myCheckVals[2]);
+ myLabelFont->SetData(myColors[1], myComboVals[1], myCheckVals[3], myCheckVals[4], myCheckVals[5]);
+
+ QDialog::reject();
+}
+/*!
+ Called when <Ok> button is clicked, store begin values
+*/
+void VisuGUI_TextPrefDlg::accept()
+{
+ storeBeginValues();
+
+ QDialog::accept();
}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
void setTitleVisible (bool isVisible)
{ (isVisible)? myTitleEdt->show() : myTitleEdt->hide(); }
+ void storeBeginValues();
+
public:
SVTK_FontWidget* myTitleFont;
SVTK_FontWidget* myLabelFont;
+ protected slots:
+ void accept();
+ void reject();
+ void onHelp();
+
private:
QLineEdit* myTitleEdt;
+ QString myTitle;
+ QColor myColors[2];
+ int myComboVals[2];
+ bool myCheckVals[6];
};
QCheckBox* myPreviewCheck;
VISU_ScalarMapAct* myPreviewActor;
VISU::ScalarMap_i* myScalarMap;
+ VISU_ScalarMapPL* myScalarMapPL;
+ std::string myTitle;
bool myBusy;
};
protected slots:
void accept();
void reject();
+ void onHelp();
protected:
VisuGUI_ScalarBarPane* myScalarPane;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// Module : VISU
#include "VisuGUI_ScalarMapOnDeformedShapeDlg.h"
+
#include "VisuGUI_Tools.h"
+
#include "VISU_Result_i.hh"
#include "VISU_ScalarMapOnDeformedShape_i.hh"
+
+#include "VISU_ScalarMapPL.hxx"
#include "VISU_ScalarMapOnDeformedShapePL.hxx"
+
+#include "VISU_Convertor.hxx"
+
#include "SalomeApp_Module.h"
+#include "LightApp_Application.h"
#include "LightApp_SelectionMgr.h"
#include "SUIT_Desktop.h"
-#include "VISU_ScalarMapPL.hxx"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
#include "SALOME_ListIO.hxx"
-#include "VISU_Convertor.hxx"
-
#include "SALOMEDSClient_AttributeComment.hxx"
#include "SALOMEDSClient_AttributeName.hxx"
VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (SalomeApp_Module* theModule)
: QDialog(VISU::GetDesktop(theModule), "VisuGUI_ScalarMapOnDeformedShapeDlg", false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+ myIsAnimation(false),
myVisuGUI(theModule)
{
myPrs = NULL;
TopGroupLayout->addWidget(FieldLabel, 1, 0);
TopGroupLayout->addWidget(myFieldsCombo,1,1);
-
+
// TimeStamps combo box
QLabel* TimeStampLabel = new QLabel (tr("TIMESTAMP_ITEM"), TopGroup, "TimeStampLabel");
myTimeStampsCombo = new QComboBox (TopGroup,"TimeStamp");
TopGroupLayout->addWidget(TimeStampLabel, 2, 0);
TopGroupLayout->addWidget(myTimeStampsCombo,2,1);
-
+
//
aTabBox->addTab(aBox, tr("SCALAR_MAP_ON_DEFORMED_SHAPE_TAB"));
buttonCancel->setAutoDefault(TRUE);
GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
+ QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp");
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
+
// Add Tab box and Buttons to the top layout
TopLayout->addWidget(aTabBox);
TopLayout->addWidget(GroupButtons);
// signals and slots connections
connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
connect(myFieldsCombo, SIGNAL(activated(int)), this, SLOT(onFieldChanged(int)));
connect(myTimeStampsCombo, SIGNAL(activated(int)), this, SLOT(onTimeStampChanged(int)));
-
}
-void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject (VISU::ScalarMapOnDeformedShape_i* thePrs,bool isAnim)
+void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject
+ (VISU::ScalarMapOnDeformedShape_i* thePrs, bool isAnim)
{
+ myIsAnimation = isAnim;
myPrs = thePrs;
- setFactor(thePrs->GetScale());
+ setFactor(myPrs->GetScale());
myTimeStampsCombo->setDisabled(isAnim);
-
- QString aFieldName(thePrs->GetScalarFieldName());
- float aIterFloat = GetFloatValueOfTimeStamp(thePrs->GetMeshName().c_str(),
- thePrs->GetScalarFieldName().c_str(),
- thePrs->GetScalarIteration(),
- thePrs->GetScalarEntity());
+
+ QString aFieldName(myPrs->GetScalarFieldName().c_str());
+ float aIterFloat = GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(),
+ myPrs->GetScalarFieldName().c_str(),
+ myPrs->GetScalarIteration(),
+ myPrs->GetScalarEntity());
QString aIteration(QString("%1").arg(aIterFloat));
-
+
if (myMeshFieldsTimes.size() == 0)
{
// find all fields and time stamps on it
Handle(SALOME_InteractiveObject) aIO = selected.First();
if (aIO->hasEntry()) {
_PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
+
+ _PTR(GenericAttribute) anTmpAttr;
+ if (aSObject->FindAttribute(anTmpAttr, "AttributeComment")) {
+ _PTR(AttributeComment) aTmpComment (anTmpAttr);
+ string aTmpComm = aTmpComment->Value();
+ QString aTmpstrIn (aTmpComm.c_str());
+ VISU::Storable::TRestoringMap aTmpaMap;
+ VISU::Storable::StrToMap(aTmpstrIn,aTmpaMap);
+ bool aTmpisExist;
+ VISU::VISUType aTmpType =
+ (VISU::VISUType)VISU::Storable::FindValue(aTmpaMap,"myType",&aTmpisExist).toInt();
+ switch(aTmpType){
+ case VISU::TTIMESTAMP:
+ {
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TFIELD:
+ {
+ _PTR(SObject) newSObject;
+ if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TANIMATION:
+ {
+ _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
+ for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
+ _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
+ _PTR(SObject) newSObject;
+ if(aTmpChildSObj->ReferencedObject(newSObject)){
+ aSObject = newSObject;
+ aSObject->GetFather();
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
aSObject = aSObject->GetFather();
aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
+
mySelectionObj = aSObject;
CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
- VISU::Result_var aResult;
if (CORBA::is_nil(anObject)) {
mySelectionObj = mySelectionObj->GetFather();
}
- _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
-
- for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
- _PTR(SObject) aChildSObj = aIter->Value();
- CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
-
- _PTR(GenericAttribute) anAttr;
- if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
- _PTR(AttributeComment) aComment (anAttr);
- string aComm = aComment->Value();
- QString strIn (aComm.c_str());
- VISU::Storable::TRestoringMap aMap;
- VISU::Storable::StrToMap(strIn,aMap);
- bool isExist;
- VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
- if (isExist) {
- if ((aType == VISU::TTIMESTAMP)) {
- _PTR(GenericAttribute) aNameAttr;
- if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
- _PTR(AttributeName) aName (aNameAttr);
- VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
- QString aMeshName = VISU::getValue(aChildSObj,"myMeshName");
- if(QString(thePrs->GetMeshName().c_str()) != aMeshName) continue;
- myCurrMeshName = aMeshName;
- QString aFieldName = VISU::getValue(aChildSObj,"myFieldName");
- QString aTimeIter = VISU::getValue(aChildSObj,"myTimeStampId");
- QString aEntity = VISU::getValue(aChildSObj,"myEntityId");
- VISU::TEntity anEntity;
- switch(aEntity.toInt()){
- case 0: anEntity = VISU::NODE_ENTITY; break;
- case 1: anEntity = VISU::EDGE_ENTITY; break;
- case 2: anEntity = VISU::FACE_ENTITY; break;
- case 3: anEntity = VISU::CELL_ENTITY; break;
- }
- TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.latin1()];
- TFE aKey(aFieldName.latin1(),anEntity);
- aFieldsMap[aKey][aTimeIter.toInt()] =
- GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(),
- aFieldName.latin1(),
- aTimeIter.toInt(),
- anEntity);
- }
- }
- }
- }
- }
}
}
-
- AddAllFieldNames();
+ if (mySelectionObj) {
+ _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
+
+ for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
+ _PTR(SObject) aChildSObj = aIter->Value();
+ CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
+
+ _PTR(GenericAttribute) anAttr;
+ if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
+ _PTR(AttributeComment) aComment (anAttr);
+ string aComm = aComment->Value();
+ QString strIn (aComm.c_str());
+ VISU::Storable::TRestoringMap aMap;
+ VISU::Storable::StrToMap(strIn,aMap);
+ bool isExist;
+ VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
+ if (isExist) {
+ if ((aType == VISU::TTIMESTAMP)) {
+ _PTR(GenericAttribute) aNameAttr;
+ if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
+ _PTR(AttributeName) aName (aNameAttr);
+ VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
+ QString aMeshName = VISU::getValue(aChildSObj, "myMeshName");
+ if (QString(myPrs->GetMeshName().c_str()) != aMeshName) continue;
+ myCurrMeshName = aMeshName;
+ QString aFieldName = VISU::getValue(aChildSObj, "myFieldName");
+ QString aTimeIter = VISU::getValue(aChildSObj, "myTimeStampId");
+ QString aEntity = VISU::getValue(aChildSObj, "myEntityId");
+ VISU::TEntity anEntity;
+ switch (aEntity.toInt()) {
+ case 0: anEntity = VISU::NODE_ENTITY; break;
+ case 1: anEntity = VISU::EDGE_ENTITY; break;
+ case 2: anEntity = VISU::FACE_ENTITY; break;
+ case 3: anEntity = VISU::CELL_ENTITY; break;
+ }
+ TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.latin1()];
+ TFE aKey (aFieldName.latin1(), anEntity);
+ aFieldsMap[aKey][aTimeIter.toInt()] =
+ GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(),
+ aFieldName.latin1(),
+ aTimeIter.toInt(),
+ anEntity);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ AddAllFieldNames();
}
myFieldsCombo->setCurrentText(aFieldName);
AddAllTimes(myFieldsCombo->currentText());
myScalarPane->initFromPrsObject(myPrs);
}
-int VisuGUI_ScalarMapOnDeformedShapeDlg::storeToPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs, bool theUpdateScalar) {
-
+int VisuGUI_ScalarMapOnDeformedShapeDlg::storeToPrsObject
+ (VISU::ScalarMapOnDeformedShape_i* thePrs, bool theUpdateScalars, int theIter)
+{
thePrs->SetScale(getFactor());
-
- thePrs->SetScalarField(myPrs->GetScalarMeshName().c_str(),
- myPrs->GetScalarFieldName().c_str(),
- myPrs->GetScalarIteration(),
- myPrs->GetScalarEntity());
- if (theUpdateScalar) SetScalarField();
+ if (myIsAnimation)
+ thePrs->SetScalarField(myPrs->GetScalarMeshName().c_str(),
+ getCurrentScalarFieldName().latin1(),
+ theIter,
+ myPrs->GetScalarEntity());
+ else
+ thePrs->SetScalarField(myPrs->GetScalarMeshName().c_str(),
+ getCurrentScalarFieldName().latin1(),
+ myTimeStampsCombo->currentItem() + 1,
+ myPrs->GetScalarEntity());
+
+ if (theUpdateScalars) SetScalarField();
thePrs->ShowColored(true);
myScalarPane->storeToPrsObject(thePrs);
-
+
myPrs = thePrs;
return 1;
aFieldName.latin1(),
theIter,
anEntity);
-
+
myScalarPane->storeToPrsObject(myPrs);
UpdateScalarField();
QDialog::reject();
}
+void VisuGUI_ScalarMapOnDeformedShapeDlg::onHelp()
+{
+ QString aHelpFileName = "scalar_map_on_deformed_shape_presentation.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
+
void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllFieldNames(){
TMF::const_iterator aIterMesh = myMeshFieldsTimes.begin();
for(;aIterMesh != myMeshFieldsTimes.end();aIterMesh++){
void VisuGUI_ScalarMapOnDeformedShapeDlg::UpdateScalarField(){
myPrs->SetScale(getFactor());
- float aRange[2];
+ vtkFloatingPointType aRange[2];
myPrs->GetScalarMapOnDeformedShapePL()->Build();
myPrs->GetScalarMapOnDeformedShapePL()->Update();
myPrs->GetScalarMapOnDeformedShapePL()->GetSourceRange(aRange);
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
void initFromPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs,bool isAnim=false);
- int storeToPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs,bool theUpdateScalar=true);
+ int storeToPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs,bool theUpdateScalars=true,int theIter=1);
int getCurrentScalarFieldNamePos();
QString getCurrentScalarFieldName();
protected slots:
void accept();
void reject();
+ void onHelp();
private slots:
void onFieldChanged(int i=0);
TMF myMeshFieldsTimes;
QString myCurrMeshName;
+ int myCurrScalarIter;
+ bool myIsAnimation;
_PTR(SObject) mySelectionObj;
VISU::ScalarMapOnDeformedShape_i* myPrs;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
#include "VISU_Actor.h"
#include "VISU_PrsObject_i.hh"
#include "SalomeApp_Study.h"
#include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
#include "LightApp_SelectionMgr.h"
#include "LightApp_VTKSelector.h"
#include "SUIT_MessageBox.h"
#include "SUIT_ViewWindow.h"
#include "SUIT_Session.h"
+#include "SUIT_ResourceMgr.h"
#include "SALOME_ListIO.hxx"
#include "SALOME_ListIteratorOfListIO.hxx"
#include "SVTK_ViewWindow.h"
-#include "SVTK_ViewModel.h"
#include "SVTK_Selector.h"
#include "utilities.h"
QPushButton* aCloseBtn = new QPushButton (tr("BUT_CLOSE"), aBtnBox);
connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close()));
+ QPushButton* aHelpBtn = new QPushButton (tr("BUT_HELP"), aBtnBox);
+ connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
+
TopLayout->addWidget(aBtnBox, 3, 0);
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
// Activate Points pane
myWidgetStack->raiseWidget(myPointsPane);
- if(SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule))
+ if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule))
aViewWindow->SetSelectionMode(NodeSelection);
onSelectionEvent();
void VisuGUI_SelectionDlg::onSelectionChange (int theId)
{
- SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule);
+ SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
if (!aViewWindow) return;
switch (theId) {
void VisuGUI_SelectionDlg::closeEvent (QCloseEvent* theEvent)
{
- if( mySelectionDlg )
- {
+ if (mySelectionDlg) {
mySelectionDlg = NULL;
disconnect(mySelectionMgr,0,0,0);
- if(SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule)){
+ if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule)) {
switch(aViewWindow->SelectionMode()){
case NodeSelection:
case CellSelection:
template<class TData> QString getValue(TData* theData, int theId){
if (vtkDataArray *aScalar = theData->GetScalars()){
- float aVal = aScalar->GetTuple1(theId);
+ vtkFloatingPointType aVal = aScalar->GetTuple1(theId);
return QString::number(aVal);
} else {
return QString("No data");
template<class TData> QString getVector(TData* theData, int theId){
if (vtkDataArray *aVector = theData->GetVectors()) {
- float *aVal = aVector->GetTuple3(theId);
+ vtkFloatingPointType *aVal = aVector->GetTuple3(theId);
return QString("%1; %2; %3").arg(aVal[0]).arg(aVal[1]).arg(aVal[2]);
} else {
return QString("No data");
#define ABS(a) (a>=0)?a:-a
void VisuGUI_SelectionDlg::onSelectionEvent() {
- SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule);
+ SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
if (!aViewWindow) return;
- switch(aViewWindow->SelectionMode()){
+ switch (aViewWindow->SelectionMode()) {
case NodeSelection:
case CellSelection:
case ActorSelection:
VISU_Actor* anVISUActor =
VISU::FindActor(aViewWindow, aSObject->GetID().c_str());
if (anVISUActor) {
- float aCoord[6];
+ vtkFloatingPointType aCoord[6];
anVISUActor->GetBounds(aCoord);
myXPosLbl->setText(QString::number( aCoord[0] ));
myYPosLbl->setText(QString::number( aCoord[2] ));
myDZLbl->setText(QString::number( ABS(aCoord[5]-aCoord[4]) ));
TColStd_IndexedMapOfInteger aMapIndex;
- typedef map<int,float*> PointsMap;
+ typedef map<int,vtkFloatingPointType*> PointsMap;
PointsMap aPointsMap;
aSelector->GetIndex(anIO, aMapIndex);
switch (aType) {
case 0:
{
- float* aCoord = anVISUActor->GetNodeCoord(anID);
+ vtkFloatingPointType* aCoord = anVISUActor->GetNodeCoord(anID);
int aVTKID = anVISUActor->GetNodeVTKID(anID);
myXValLbl->setText( QString::number( aCoord[0] ) );
myYValLbl->setText( QString::number( aCoord[1] ) );
myCellScalarValLbl->setText(getValue(aCellData, aVTKID));
myCellVectorValLbl->setText(getVector(aCellData, aVTKID));
- float* aCoord;
+ vtkFloatingPointType* aCoord;
vtkIdList *aPointList = aCell->GetPointIds();
for (int i = 0; i < aNbOfPoints; i++) {
myListPoints->verticalHeader()->setLabel(i, QString::number( i ));
int id = It->first;
myListPoints->setText(i, 0, QString::number( id ));
- float* aCoord = It->second;
+ vtkFloatingPointType* aCoord = It->second;
myListPoints->setText(i, 1, QString::number( aCoord[0] ));
myListPoints->setText(i, 2, QString::number( aCoord[1] ));
myListPoints->setText(i, 3, QString::number( aCoord[2] ));
QLabel* theFieldName)
{
SalomeApp_Application* anApp = theModule->getApp();
- SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(theModule);
+ SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule);
if (!aViewWindow) return false;
SVTK_Selector* aSelector = aViewWindow->GetSelector();
else
clearFields();
}
+
+void VisuGUI_SelectionDlg::onHelp()
+{
+ QString aHelpFileName = "/files/getting_elements_attributes.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName);
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
void onSelectionEvent ();
void onPointIdEdit (const QString& theText);
void onCellIdEdit (const QString& theText);
+ void onHelp();
private:
void clearFields ();
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VisuGUI_SetupPlot2dDlg.cxx
// Author : Vadim SANDLER
// $Header$
#include "VisuGUI_SetupPlot2dDlg.h"
+#include "VisuGUI.h"
#include "SPlot2d_Curve.h"
#include "SUIT_Tools.h"
#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+
+#include "LightApp_Application.h"
#include <SALOMEDSClient_AttributeTableOfInteger.hxx>
#include <SALOMEDSClient_AttributeTableOfReal.hxx>
myView->setMinimumWidth( frame->sizeHint().width() + MARGIN_SIZE * 2 );
- /* OK/Cancel buttons */
+ /* OK/Cancel/Help buttons */
myOkBtn = new QPushButton( tr( "BUT_OK" ), this, "buttonOk" );
myOkBtn->setAutoDefault( TRUE );
myOkBtn->setDefault( TRUE );
myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this, "buttonCancel" );
myCancelBtn->setAutoDefault( TRUE );
+ myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this, "buttonHelp" );
+ myHelpBtn->setAutoDefault( TRUE );
- topLayout->addMultiCellWidget( myView, 0, 0, 0, 2 );
+ topLayout->addMultiCellWidget( myView, 0, 0, 0, 3 );
topLayout->addWidget( myOkBtn, 1, 0 );
topLayout->setColStretch( 1, 5 );
topLayout->addWidget( myCancelBtn, 1, 2 );
+ topLayout->addWidget( myHelpBtn, 1, 3 );
connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
enableControls();
}
enableControls();
}
+/*!
+ Slot, called when <Help> button is clicked
+*/
+void VisuGUI_SetupPlot2dDlg::onHelp()
+{
+ QString aHelpFileName = "/files/creating_curves.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+ app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ }
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
/*!
Enables/disables buttons
*/
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VisuGUI_SetupPlot2dDlg.h
// Author : Vadim SANDLER
// Module : SALOME
-// $Header$
#ifndef VISUGUI_SetupPlot2dDlg_H
#define VISUGUI_SetupPlot2dDlg_H
private slots:
void onHBtnToggled( bool );
void onVBtnToggled( bool );
+ void onHelp();
void enableControls();
private:
QScrollView* myView;
QPushButton* myOkBtn;
QPushButton* myCancelBtn;
+ QPushButton* myHelpBtn;
QPtrList<VisuGUI_ItemContainer> myItems;
_PTR(SObject) myObject;
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VisuGUI_StreamLinesDlg.cxx
// Author : Vitaly SMETANNIKOV
#include "VISU_Actor.h"
#include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
#include "LightApp_SelectionMgr.h"
#include "SVTK_ViewWindow.h"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_MessageBox.h"
connect(myUseSrcCombo, SIGNAL(activated(int)), this, SLOT(onSourceTypeChange(int)));
- // Find All prs obj
- //SUIT_Study* aActiveStudy = VISU::(myVisuGUI);
+ // Find all fields and time stamps on it
_PTR(Study) aActiveStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI));
LightApp_SelectionMgr* aSel = VISU::GetSelectionMgr(myVisuGUI);
SALOME_ListIO selected;
Handle(SALOME_InteractiveObject) aIO = selected.First();
if (aIO->hasEntry()) {
_PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
+
+ _PTR(GenericAttribute) anTmpAttr;
+ if (aSObject->FindAttribute(anTmpAttr, "AttributeComment")) {
+ _PTR(AttributeComment) aTmpComment (anTmpAttr);
+ string aTmpComm = aTmpComment->Value();
+ QString aTmpstrIn (aTmpComm.c_str());
+ VISU::Storable::TRestoringMap aTmpaMap;
+ VISU::Storable::StrToMap(aTmpstrIn,aTmpaMap);
+ bool aTmpisExist;
+ VISU::VISUType aTmpType =
+ (VISU::VISUType)VISU::Storable::FindValue(aTmpaMap,"myType",&aTmpisExist).toInt();
+ switch (aTmpType) {
+ case VISU::TTIMESTAMP:
+ {
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TFIELD:
+ {
+ _PTR(SObject) newSObject;
+ if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TANIMATION:
+ {
+ _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
+ for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
+ _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
+ _PTR(SObject) newSObject;
+ if(aTmpChildSObj->ReferencedObject(newSObject)){
+ aSObject = newSObject;
+ aSObject->GetFather();
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
aSObject = aSObject->GetFather();
aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
+
mySelectionObj = aSObject;
CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
- VISU::Result_var aResult;
if (CORBA::is_nil(anObject)) {
mySelectionObj = mySelectionObj->GetFather();
}
- _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
-
- for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
- _PTR(SObject) aChildSObj = aIter->Value();
- CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
-
- if (!CORBA::is_nil(aChildObject)) {
- VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
- if (!CORBA::is_nil(aPrsObj)) { // if this is a Prs object
- if ((aPrsObj->GetType() != VISU::TSTREAMLINES) &&
- (aPrsObj->GetType() != VISU::TMESH)) {
- _PTR(GenericAttribute) anAttr;
- if (aChildSObj->FindAttribute(anAttr, "AttributeName")) {
- _PTR(AttributeName) aName (anAttr);
- myPrsLst += QString(aName->Value().c_str());
- myPrsList.append(aPrsObj);
- continue;
- }
- }
- }
- }
- // else { // This is not a Prs object
- _PTR(GenericAttribute) anAttr;
- if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
- _PTR(AttributeComment) aComment (anAttr);
- string aComm = aComment->Value();
- QString strIn (aComm.c_str());
- VISU::Storable::TRestoringMap aMap;
- VISU::Storable::StrToMap(strIn,aMap);
- bool isExist;
- VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
- if (isExist) {
- if ((aType == VISU::TFAMILY) || (aType == VISU::TGROUP) || (aType == VISU::TENTITY)) {
- _PTR(GenericAttribute) aNameAttr;
- if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
- _PTR(AttributeName) aName (aNameAttr);
- VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
- switch (aType) {
- case VISU::TFAMILY:
- myFamilisLst += QString(aName->Value().c_str());
- myFamilyList.append(aPrsObj);
- break;
- case VISU::TGROUP:
- myGroupsLst += QString(aName->Value().c_str());
- myGroupList.append(aPrsObj);
- break;
- case VISU::TENTITY:
- myEntitiesLst += QString(aName->Value().c_str());
- myEntityList.append(aPrsObj);
- break;
- }
- }
- }
- }
- }
+ }
+ }
+
+ if (mySelectionObj) {
+ _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
+
+ for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
+ _PTR(SObject) aChildSObj = aIter->Value();
+ CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
+
+ if (!CORBA::is_nil(aChildObject)) {
+ VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
+ if (!CORBA::is_nil(aPrsObj)) { // if this is a Prs object
+ if ((aPrsObj->GetType() != VISU::TSTREAMLINES) &&
+ (aPrsObj->GetType() != VISU::TMESH)) {
+ _PTR(GenericAttribute) anAttr;
+ if (aChildSObj->FindAttribute(anAttr, "AttributeName")) {
+ _PTR(AttributeName) aName (anAttr);
+ myPrsLst += QString(aName->Value().c_str());
+ myPrsList.append(aPrsObj);
+ continue;
+ }
+ }
+ }
+ }
+
+ _PTR(GenericAttribute) anAttr;
+ if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
+ _PTR(AttributeComment) aComment (anAttr);
+ string aComm = aComment->Value();
+ QString strIn (aComm.c_str());
+ VISU::Storable::TRestoringMap aMap;
+ VISU::Storable::StrToMap(strIn,aMap);
+ bool isExist;
+ VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
+ if (isExist) {
+ if ((aType == VISU::TFAMILY) || (aType == VISU::TGROUP) || (aType == VISU::TENTITY)) {
+ _PTR(GenericAttribute) aNameAttr;
+ if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
+ _PTR(AttributeName) aName (aNameAttr);
+ VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
+ switch (aType) {
+ case VISU::TFAMILY:
+ myFamilisLst += QString(aName->Value().c_str());
+ myFamilyList.append(aPrsObj);
+ break;
+ case VISU::TGROUP:
+ myGroupsLst += QString(aName->Value().c_str());
+ myGroupList.append(aPrsObj);
+ break;
+ case VISU::TENTITY:
+ myEntitiesLst += QString(aName->Value().c_str());
+ myEntityList.append(aPrsObj);
+ break;
+ }
+ }
+ }
+ }
}
}
}
QPushButton* aCancelBtn = new QPushButton( tr( "&Cancel" ) , aGroupButtons, "buttonCancel" );
aCancelBtn->setAutoDefault( TRUE );
aGroupButtonsLayout->addWidget( aCancelBtn, 0, 2 );
+
+ QPushButton* aHelpBtn = new QPushButton( tr( "&Help" ) , aGroupButtons, "buttonHelp" );
+ aHelpBtn->setAutoDefault( TRUE );
+ aGroupButtonsLayout->addWidget( aHelpBtn, 0, 3 );
+
connect( aOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ connect( aHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
aBoxLayout->addWidget(aGroupButtons);
}
-
void VisuGUI_StreamLinesDlg::initFromPrsObject (VISU::StreamLines_i* thePrs)
{
myScalarPane->initFromPrsObject(thePrs);
myScalarPane->deletePreview();
QDialog::reject();
}
+
+void VisuGUI_StreamLinesDlg::onHelp()
+{
+ QString aHelpFileName = "/files/stream_lines_presentation.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VisuGUI_StreamLinesDlg.h
// Author : Vitaly SMETANNIKOV
protected slots:
void accept();
void reject();
+ void onHelp();
private slots:
- //void onSelectionActive(bool theActive);
+//VSR: 08/06/06: void onSelectionActive(bool theActive);
void StepLengthChanged(double theValue);
void IntegrationStepChanged(double theValue);
void PropagationTimeChanged(double theValue);
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VisuGUI_TimeAnimation.cxx
// Author : Vitaly SMETANNIKOV
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
#include "VisuGUI_DeformedShapeDlg.h"
#include "VisuGUI_CutPlanesDlg.h"
#include "VisuGUI_CutLinesDlg.h"
#include "VISU_Actor.h"
#include "SalomeApp_Study.h"
-#include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
#include "SVTK_ViewWindow.h"
#include "SUIT_OverrideCursor.h"
#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
#include "SUIT_Desktop.h"
#include "SUIT_FileDlg.h"
#define MAXVAL 1e10
ArrangeDlg::ArrangeDlg(QWidget* theParent, VISU_TimeAnimation* theAnimator)
- : QDialog(theParent, "ArrangeDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
- myAnimator(theAnimator), myViewWindow(theAnimator->getViewer())
+ : QDialog(theParent, "ArrangeDlg", true,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+ myAnimator(theAnimator),
+ myViewWindow(theAnimator->getViewer())
{
myCurrent = 0;
init();
QStringList aFieldNames;
// Find names of fields
- for (int i = 0; i < theAnimator->getNbFields(); i++) {
- aFieldNames.append(VISU::getValue(theAnimator->getFieldData(i).myField, "myName"));
+ for (int i = 0; i < myAnimator->getNbFields(); i++) {
+ aFieldNames.append(VISU::getValue(myAnimator->getFieldData(i).myField, "myName"));
Offset aOffs;
aOffs.myOffset[0] = myAnimator->getFieldData(i).myOffset[0];
aOffs.myOffset[1] = myAnimator->getFieldData(i).myOffset[1];
ArrangeDlg::ArrangeDlg(QWidget* theParent, SVTK_ViewWindow* theViewWindow)
: QDialog(theParent, "ArrangeDlg", true, WStyle_Customize |
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
- myAnimator(0), myViewWindow(theViewWindow)
+ myAnimator(NULL), myViewWindow(theViewWindow)
{
myCurrent = 0;
init();
void ArrangeDlg::accept()
{
- if (myAnimator) {
+ if (myAnimator != NULL) {
acceptAnimation();
} else {
acceptViewWindow();
}
} else {
QApplication::setOverrideCursor( Qt::waitCursor );
- FieldData& aData = myAnimator->getFieldData(0);
+ FieldData& aData = myAnimator->getFieldData(myFieldLst->currentItem());
if (aData.myPrs.empty())
- myAnimator->generatePresentations(0);
- VISU_Actor* aActor = aData.myPrs[0]->CreateActor();
- float aBounds[6];
- aActor->GetBounds(aBounds);
- aActor->Delete();
- float aDist = 0;
+ myAnimator->generatePresentations(myFieldLst->currentItem());
+ vtkFloatingPointType aBounds[6];
+ aData.myPrs[0]->GetBounds(aBounds);
+ vtkFloatingPointType aDist = 0;
int aAxis = getAxis();
switch (aAxis) {
case XAxis:
aDist = fabs(aBounds[5] - aBounds[4]);
}
- float dx = fabs(aBounds[1] - aBounds[0]);
- float dy = fabs(aBounds[3] - aBounds[2]);
- float dz = fabs(aBounds[5] - aBounds[4]);
- float max = (dx > dy) ? dx : dy;
+ vtkFloatingPointType dx = fabs(aBounds[1] - aBounds[0]);
+ vtkFloatingPointType dy = fabs(aBounds[3] - aBounds[2]);
+ vtkFloatingPointType dz = fabs(aBounds[5] - aBounds[4]);
+ vtkFloatingPointType max = (dx > dy) ? dx : dy;
max = (dz > max) ? dz : max;
max /= 100.0;
anActor->SetPosition(aOffs.myOffset);
if (mySaveChk)
if (mySaveChk->isChecked())
- aPrs->SetOffset(aOffs.myOffset);
+ aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]);
}
} else {
- float aDist = 0;
- float aShift = 0;
- float aPrevDist = 0;
- float aPrevShift = 0;
+ vtkFloatingPointType aDist = 0;
+ vtkFloatingPointType aShift = 0;
+ vtkFloatingPointType aPrevDist = 0;
+ vtkFloatingPointType aPrevShift = 0;
int i;
QMap<VISU::Prs3d_i*, int>::Iterator it;
for (it = myPrsMap.begin(), i = 0; it != myPrsMap.end(); ++it, i++) {
if (VISU_Actor* aActor = VISU::GetActor(aPrs, myViewWindow)) {
int aAxis = getAxis();
- float aZeroOffset[3];
+ vtkFloatingPointType aZeroOffset[3];
aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0;
aActor->SetPosition(aZeroOffset);
aActor->GetMapper()->Update();
- float aBounds[6];
+ vtkFloatingPointType aBounds[6];
aActor->GetBounds(aBounds);
switch (aAxis) {
case XAxis:
case ZAxis:
aDist = fabs(aBounds[5] - aBounds[4]);
}
- float aOffset[3];
+ vtkFloatingPointType aOffset[3];
aOffset[0] = aOffset[1] = aOffset[2] = 0;
aOffset[aAxis] =
(aBounds[2*aAxis+1] < aBounds[2*aAxis]) ? -aBounds[2*aAxis+1] : -aBounds[2*aAxis];
if (i > 0) {
- float aCCDist = (aDist + aPrevDist) / 2.0;
+ vtkFloatingPointType aCCDist = (aDist + aPrevDist) / 2.0;
- float dx = fabs(aBounds[1] - aBounds[0]);
- float dy = fabs(aBounds[3] - aBounds[2]);
- float dz = fabs(aBounds[5] - aBounds[4]);
- float max = (dx > dy) ? dx : dy;
+ vtkFloatingPointType dx = fabs(aBounds[1] - aBounds[0]);
+ vtkFloatingPointType dy = fabs(aBounds[3] - aBounds[2]);
+ vtkFloatingPointType dz = fabs(aBounds[5] - aBounds[4]);
+ vtkFloatingPointType max = (dx > dy) ? dx : dy;
max = (dz > max) ? dz : max;
max /= 100.0;
aActor->SetPosition(aOffset);
if (mySaveChk)
if (mySaveChk->isChecked())
- aPrs->SetOffset(aOffset);
+ aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]);
aPrevDist = aDist;
aPrevShift = aShift;
QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 6);
aMainLayout->setSpacing(5);
+ // Range of time stamps
QFrame* aRangeGrp = new QFrame(this);
QGridLayout* aRangeLayout = new QGridLayout( aRangeGrp );
aRangeLayout->setSpacing( 6 );
aRangeLayout->addMultiCellWidget(myUseRangeChk, 0, 0, 0, 3);
myUseRangeChk->setChecked(myAnimator->isRangeDefined());
+ double aMaxTime = myAnimator->getMaxTime();
+ double aMinTime = myAnimator->getMinTime();
+ double aStep = (aMaxTime - aMinTime) / (myAnimator->getFieldData(0).myNbTimes - 1);
+
QLabel* aMinLbl = new QLabel("From", aRangeGrp);
aMinLbl->setEnabled(myUseRangeChk->isChecked());
aRangeLayout->addWidget(aMinLbl, 1, 0);
- double aStep = (myAnimator->getMaxTime() - myAnimator->getMinTime())/(theAnimator->getFieldData(0).myNbTimes - 1);
- myMinVal = new QtxDblSpinBox( myAnimator->getMinTime(), myAnimator->getMaxTime(), aStep, aRangeGrp );
+ myMinVal = new QtxDblSpinBox( aMinTime, aMaxTime, aStep, aRangeGrp );
myMinVal->setEnabled(myUseRangeChk->isChecked());
if (myUseRangeChk->isChecked())
myMinVal->setValue( myAnimator->getMinRange() );
else
- myMinVal->setValue( myAnimator->getMinTime() );
+ myMinVal->setValue( aMinTime );
connect(myMinVal, SIGNAL( valueChanged(double)),
this, SLOT( onMinValue(double) ));
QLabel* aMaxLbl = new QLabel("To", aRangeGrp);
aMaxLbl->setEnabled(myUseRangeChk->isChecked());
aRangeLayout->addWidget(aMaxLbl, 1, 2);
- myMaxVal = new QtxDblSpinBox( myAnimator->getMinTime(), myAnimator->getMaxTime(), aStep, aRangeGrp );
+ myMaxVal = new QtxDblSpinBox( aMinTime, aMaxTime, aStep, aRangeGrp );
myMaxVal->setEnabled(myUseRangeChk->isChecked());
if (myUseRangeChk->isChecked())
myMaxVal->setValue( myAnimator->getMaxRange() );
else
- myMaxVal->setValue( myAnimator->getMaxTime() );
+ myMaxVal->setValue( aMaxTime );
connect(myMaxVal, SIGNAL( valueChanged(double)),
this, SLOT( onMaxValue(double) ));
aMainLayout->addWidget(aRangeGrp);
+ // Fields and Properties
QHBox* aPropFrame = new QHBox(this);
aPropFrame->setSpacing(5);
myFieldLst = new QListBox(aNamesBox);
QStringList aFieldNames;
// Find names of fields
- for (int i = 0; i < theAnimator->getNbFields(); i++) {
- _PTR(SObject) aSO = theAnimator->getFieldData(i).myField;
+ for (int i = 0; i < myAnimator->getNbFields(); i++) {
+ _PTR(SObject) aSO = myAnimator->getFieldData(i).myField;
aFieldNames.append(VISU::getValue(aSO, "myName"));
}
myFieldLst->insertStringList(aFieldNames);
// this, SLOT( onScalarBarDlg() ) );
myPropBtn = new QPushButton("Properties...", aPropBox);
- // myPropBtn->setEnabled(theAnimator->getFieldData(0).myPrsType != VISU::TSCALARMAP);
+ // myPropBtn->setEnabled(myAnimator->getFieldData(0).myPrsType != VISU::TSCALARMAP);
connect( myPropBtn, SIGNAL( clicked() ),
this, SLOT( onPreferencesDlg() ) );
myTypeCombo->setCurrentItem(myTypeId2ComboId[TDEFORMEDSHAPE_ITEM]);
break;
case VISU::TSCALARMAPONDEFORMEDSHAPE: //Scalar Map on Deformed Shape
- myTypeCombo->setCurrentItem(TSCALARMAPONDEFORMEDSHAPE_ITEM);
+ myTypeCombo->setCurrentItem(myTypeId2ComboId[TSCALARMAPONDEFORMEDSHAPE_ITEM]);
break;
case VISU::TVECTORS: //Vectors
myTypeCombo->setCurrentItem(myTypeId2ComboId[TVECTORS_ITEM]);
if (aData.myPrs.empty())
myAnimator->generatePresentations(myFieldLst->currentItem());
+ if(!aData.myNbFrames || !aData.myPrs[0]){
+ QApplication::restoreOverrideCursor();
+ SUIT_MessageBox::warn1(this,
+ tr("ERROR"),
+ VisuGUI_TimeAnimationDlg::tr("MSG_NO_ANIMATIONDATA"),
+ tr("&OK"));
+ return;
+ }
+
int aType = myComboId2TypeId[myTypeCombo->currentItem()];
switch (aType) {
case TSCALARMAP_ITEM: //Scalar Map
if (aDlg->exec())
{
int anbFrames=aDlg->getCurrentScalarNbIterations();
+ int aIter = 0;
for (int i = 0; i < aData.myNbFrames; i++){
TYPE* aCurrPrs_i = dynamic_cast<TYPE*>(aData.myPrs[i]);
+ aIter = i+1;
if(i+1 > anbFrames)
- aDlg->SetScalarField(anbFrames);
- else
- aDlg->SetScalarField(i+1);
- aDlg->storeToPrsObject(aCurrPrs_i,false);
+ aIter=anbFrames;
+ aDlg->storeToPrsObject(aCurrPrs_i,false,aIter);
}
}
delete aDlg;
myAnimator = new VISU_TimeAnimation (theStudy);
myAnimator->setSpeed(1);
- myAnimator->setViewer(VISU::GetViewWindow(theModule));
+ myAnimator->setViewer(VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule));
connect(myAnimator, SIGNAL(frameChanged(long, double)), this, SLOT(onExecution(long, double)));
connect(myAnimator, SIGNAL(stopped()), this, SLOT(onStop()));
aSaveLay->setMargin( 5 );
mySaveCheck = new QCheckBox("Save pictures to directory", aSaveBox);
+ connect(mySaveCheck, SIGNAL( toggled(bool)),
+ this, SLOT( onCheckDump(bool) ));
aSaveLay->addMultiCellWidget(mySaveCheck, 0, 0, 0, 2);
QLabel* aFormatLbl = new QLabel("Saving format:", aSaveBox);
aSaveLay->addWidget(myPicsFormat, 1, 2);
connect(mySaveCheck, SIGNAL( toggled(bool)),
myPicsFormat, SLOT( setEnabled(bool) ));
+ connect(myPicsFormat, SIGNAL( activated (int)),
+ this, SLOT( onPicsFormatChanged()));
QLabel* aPathLbl = new QLabel("Path:", aSaveBox);
aPathLbl->setEnabled(false);
mySaveCheck->setChecked(false);
aSaveLay->addWidget(aBrowseBtn, 2, 2);
+ mySaveAVICheck = new QCheckBox("Save animation to AVI file", aSaveBox);
+ connect(mySaveAVICheck, SIGNAL( toggled(bool)),
+ this, SLOT( onCheckDump(bool) ));
+ aSaveLay->addMultiCellWidget(mySaveAVICheck, 3, 3, 0, 2);
+
+ QLabel* aPathAVILbl = new QLabel("Path:", aSaveBox);
+ aPathAVILbl->setEnabled(false);
+ connect(mySaveAVICheck, SIGNAL( toggled(bool)),
+ aPathAVILbl, SLOT( setEnabled(bool) ));
+ aSaveLay->addWidget(aPathAVILbl, 4, 0);
+
+ myPathAVIEdit = new QLineEdit(aSaveBox);
+ myPathAVIEdit->setReadOnly(true);
+ myPathAVIEdit->setEnabled(false);
+ connect(mySaveAVICheck, SIGNAL( toggled(bool)),
+ myPathAVIEdit, SLOT( setEnabled(bool) ));
+ aSaveLay->addWidget(myPathAVIEdit, 4, 1);
+
+ QPushButton* aBrowseAVIBtn = new QPushButton("Browse...", aSaveBox);
+ aBrowseAVIBtn->setEnabled(false);
+ connect(mySaveAVICheck, SIGNAL( toggled(bool)),
+ aBrowseAVIBtn, SLOT( setEnabled(bool) ));
+ connect(aBrowseAVIBtn, SIGNAL( clicked()),
+ this, SLOT( onBrowseAVI() ));
+ aSaveLay->addWidget(aBrowseAVIBtn, 4, 2);
+
+ mySaveAVICheck->setChecked(false);
+ mySaveAVICheck->setEnabled(myAnimator->checkAVIMaker());
+
TopLayout->addMultiCellWidget(aSaveBox, 7, 7, 0, 3);
aMainLayout->addWidget(myPlayFrame);
QPushButton* aCloseBtn = new QPushButton(tr("BUT_CLOSE"), aBtnBox);
connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close()));
+ QPushButton* aHelpBtn = new QPushButton(tr("BUT_HELP"), aBtnBox);
+ connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
+
SUIT_Study* aStudy = VISU::GetAppStudy(myModule);
connect(aStudy, SIGNAL(destroyed()), this, SLOT(close()));
+ connect(myAnimator->getViewer(), SIGNAL(destroyed()), this, SLOT(close()));
+ connect(myAnimator->getViewer(), SIGNAL(closing(SUIT_ViewWindow*)), this, SLOT(close()));
+
aMainLayout->addWidget(aBtnBox);
myPlayFrame->setEnabled(false);
//------------------------------------------------------------------------
VisuGUI_TimeAnimationDlg::~VisuGUI_TimeAnimationDlg()
{
- delete myAnimator;
+ if(myAnimator != NULL){
+ delete myAnimator;
+ myAnimator = NULL;
+ VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule)->Repaint();
+ }
}
//------------------------------------------------------------------------
if (myPlayBtn->isOn() && (!myAnimator->running())) {
myPlayBtn->setIconSet(MYpausePixmap);
if (mySaveCheck->isChecked()) {
- QStrList aDumpFormats = QImageIO::outputFormats();
- myAnimator->setDumpFormat(aDumpFormats.at(myPicsFormat->currentItem()));
- myAnimator->dumpTo(myPathEdit->text());
+ onPicsFormatChanged();
+ onPathChanged();
+
+ } else if (mySaveAVICheck->isChecked()) {
+ myAnimator->setDumpFormat("AVI");
+ myAnimator->dumpTo(myPathAVIEdit->text());
} else {
myAnimator->dumpTo("");
}
mySetupDlg = new SetupDlg(this,myModule, myAnimator);
}
+void VisuGUI_TimeAnimationDlg::reject()
+{
+ close();
+ QDialog::reject();
+}
+
//------------------------------------------------------------------------
void VisuGUI_TimeAnimationDlg::closeEvent (QCloseEvent* theEvent)
{
- myAnimator->stopAnimation();
- myAnimator->wait(500);
- if (myAnimator->running() && (! myAnimator->finished())) {
- isClosing = true;
- myEvent = theEvent;
+ if(myAnimator != NULL){
+ myAnimator->stopAnimation();
+ myAnimator->wait(500);
+ if (myAnimator->running() && (! myAnimator->finished())) {
+ isClosing = true;
+ myEvent = theEvent;
+ // * Destroing data in myAnimator before study closed.
+ // * It needed for correcting destroing of myAnimator, which
+ // * depend from SVTK_RenderWindowInteractor() e.t.c.
+ if(theEvent->type() == QEvent::Close){
+ for (int i = 0; i < myAnimator->getNbFields(); i++)
+ myAnimator->clearData(myAnimator->getFieldData(i));
+ myAnimator->clearFieldData();
+ }
+ } else {
+ QDialog::closeEvent(theEvent);
+ }
} else {
QDialog::closeEvent(theEvent);
}
//------------------------------------------------------------------------
void VisuGUI_TimeAnimationDlg::onBrowse()
{
- QString aPath = SUIT_FileDlg::getExistingDirectory(this, "/", "Select path");
+ // QString aPath = SUIT_FileDlg::getExistingDirectory(this, "/", "Select path");
+ QString aDir;
+ if (myPathEdit->text().isEmpty())
+ aDir = getenv("HOME");
+ else
+ aDir = myPathEdit->text();
+ QString aPath = SUIT_FileDlg::getExistingDirectory(this, aDir, "Select path");
if (!aPath.isEmpty())
myPathEdit->setText(Qtx::addSlash(aPath));
+ onPathChanged();
+}
+
+//------------------------------------------------------------------------
+void VisuGUI_TimeAnimationDlg::onBrowseAVI()
+{
+ QStringList aFilter;
+ aFilter.append( "AVI Files (*.avi)" );
+ aFilter.append( "All Files (*.*)" );
+
+ QString aDir;
+ if (myPathAVIEdit->text().isEmpty())
+ aDir = getenv("HOME");
+ else {
+ QFileInfo aFile(myPathAVIEdit->text());
+ aDir = aFile.dirPath(true);
+ }
+ QString aPath = SUIT_FileDlg::getFileName(this, aDir, aFilter, "Select file", false);
+ if (!aPath.isEmpty())
+ myPathAVIEdit->setText(aPath);
+}
+
+//------------------------------------------------------------------------
+void VisuGUI_TimeAnimationDlg::onCheckDump(bool)
+{
+ const QObject* source = sender();
+ if (source == mySaveCheck) {
+ if (mySaveCheck->isChecked()) {
+ onPicsFormatChanged();
+ onPathChanged();
+ if (mySaveAVICheck->isChecked())
+ mySaveAVICheck->setChecked(false);
+ } else {
+ myAnimator->dumpTo("");
+ }
+ mySaveAVICheck->setEnabled(!mySaveCheck->isChecked() && myAnimator->checkAVIMaker());
+ }
+ else if (source == mySaveAVICheck) {
+ if (mySaveAVICheck->isChecked()) {
+ if (mySaveCheck->isChecked())
+ mySaveCheck->setChecked(false);
+ }
+ mySaveCheck->setEnabled(!mySaveAVICheck->isChecked());
+ }
}
//------------------------------------------------------------------------
}
}
+//------------------------------------------------------------------------
+void VisuGUI_TimeAnimationDlg::onHelp()
+{
+ QString aHelpFileName = "/files/animating_presentations.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName);
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
+
//------------------------------------------------------------------------
void VisuGUI_TimeAnimationDlg::saveToStudy()
{
myAnimator->restoreFromStudy(theAnimation);
mySaveBtn->setEnabled(myAnimator->isSavedInStudy());
}
+
+//------------------------------------------------------------------------
+void VisuGUI_TimeAnimationDlg::onPicsFormatChanged()
+{
+ QStrList aDumpFormats = QImageIO::outputFormats();
+ myAnimator->setDumpFormat(aDumpFormats.at(myPicsFormat->currentItem()));
+}
+
+//------------------------------------------------------------------------
+void VisuGUI_TimeAnimationDlg::onPathChanged()
+{
+ myAnimator->dumpTo(myPathEdit->text());
+}
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VisuGUI_TimeAnimation.h
// Author : Vitaly SMETANNIKOV
#define VISUGUI_TIMEANIMATION_H
#include "QtxDblSpinBox.h"
-
#include "SALOMEDSClient_Study.hxx"
+#include "VTKViewer.h"
+
#include <qdialog.h>
#include <qbuttongroup.h>
#include <qwidgetstack.h>
+#include <vector>
+#include <map>
+
class VisuGUI;
class VISU_TimeAnimation;
private:
struct Offset {
- float myOffset[3];
+ vtkFloatingPointType myOffset[3];
};
protected:
virtual void closeEvent(QCloseEvent* theEvent);
virtual void showEvent(QShowEvent* theEvent);
+ virtual void reject();
void stopAnimation();
private slots:
void onSpeedChange(double theSpeed);
void onExecution(long theNewFrame, double theTime);
void onBrowse();
+ void onBrowseAVI();
+ void onCheckDump(bool);
void onStop();
+ void onHelp();
void saveToStudy();
void publishToStudy();
+ /*!Sets dump format for myAnimator (setDumpFormat(...)), from myPicsFormat.*/
+ void onPicsFormatChanged();
+ /*!Sets path for myAnimator (dumpTo(...)), from myPathEdit.*/
+ void onPathChanged();
private:
QSlider* mySlider;
bool isClosing;
QCloseEvent* myEvent;
+ QCheckBox* mySaveAVICheck;
+ QLineEdit* myPathAVIEdit;
+
QPushButton* myPublishBtn;
QPushButton* mySaveBtn;
};
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "VisuGUI_Tools.h"
+#include "VisuGUI.h"
+#include "VisuGUI_ViewTools.h"
+
#include "VISU_Gen_i.hh"
#include "VISU_Prs3d_i.hh"
#include "VISU_Result_i.hh"
#include "SalomeApp_Study.h"
#include "SalomeApp_Application.h"
-#include "OB_Browser.h"
#include "LightApp_DataObject.h"
#include "LightApp_SelectionMgr.h"
+#include "OB_Browser.h"
+
#include "SALOME_ListIO.hxx"
#include "SALOME_ListIteratorOfListIO.hxx"
#include "SVTK_ViewWindow.h"
-#include "SVTK_ViewModel.h"
#include "SVTK_Functor.h"
#include "VTKViewer_Algorithm.h"
#include "SPlot2d_ViewModel.h"
#include "Plot2d_ViewFrame.h"
+#include "Plot2d_ViewManager.h"
#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
-#include "VisuGUI.h"
-
#include <vtkRenderer.h>
#include <vtkActorCollection.h>
for (; anIter.More(); anIter.Next()) {
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
if (anIO->hasEntry()) {
+
+ // asv : if selected object is a Save Point object selected in object browser - return false
+ if ( QString( anIO->getEntry() ).startsWith( QObject::tr( "SAVE_POINT_DEF_NAME" ) ) )
+ return false;
+
_PTR(SObject) aSObject = aStudy->FindObjectID(anIO->getEntry());
VISU::Storable::TRestoringMap pMap;
if (aSObject) {
return true;
}
- // Display/Erase
-
- void
- ErasePrs (const SalomeApp_Module* theModule,
- CORBA::Object_ptr theObject, bool theUpdate)
- {
- if (!CORBA::is_nil(theObject)) {
- VISU::Base_var aBase = VISU::Base::_narrow(theObject);
- if (CORBA::is_nil(aBase)) return;
- VISU::VISUType aType = aBase->GetType();
- switch (aType) {
- case VISU::TCURVE:
- {
- if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aBase).in()))
- PlotCurve(theModule, aCurve, VISU::eErase );
- break;
- }
- case VISU::TCONTAINER:
- {
- if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aBase).in()))
- PlotContainer(theModule, aContainer, VISU::eErase );
- break;
- }
- case VISU::TTABLE:
- {
- if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aBase).in()))
- PlotTable(theModule, aTable, VISU::eErase );
- break;
- }
- default:
- {
- if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aBase).in())) {
- ErasePrs3d(theModule, aPrsObject);
- if (theUpdate) {
- if (SVTK_ViewWindow* vw = GetViewWindow(theModule))
- vw->Repaint();
- }
- }
- }
- } // switch (aType)
- }
- }
-
void
DeleteSObject(VisuGUI* theModule,
_PTR(Study) theStudy,
_PTR(ChildIterator) aChildIter = theStudy->NewChildIterator(theSObject);
for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
_PTR(SObject) aChildSObject = aChildIter->Value();
-
CORBA::Object_var aChildObj = VISU::ClientSObjectToObject(aChildSObject);
- RemoveScalarBarPosition(theModule,aChildObj);
- ErasePrs(theModule, aChildObj);
+ ErasePrs(theModule, aChildObj, /*repaint_view_window = */false);
}
CORBA::Object_var anObj = VISU::ClientSObjectToObject(theSObject);
if (!CORBA::is_nil(anObj)) {
- RemoveScalarBarPosition(theModule,anObj);
- ErasePrs(theModule, anObj);
+ ErasePrs(theModule, anObj, /*repaint_view_window = */true);
VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(anObj);
if (!CORBA::is_nil(aRemovableObject)) {
if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule)))
return;
- RemoveScalarBarPosition(theModule,thePrs);
- thePrs->RemoveFromStudy();
- }
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+ RemoveScalarBarPosition(theModule, vw, thePrs);
- void
- ErasePrs3d(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs)
- {
- if ( SVTK_ViewWindow* vw = GetViewWindow( theModule ) ){
- if (VISU_Actor* anVISUActor = FindActor( vw, thePrs )) {
- anVISUActor->VisibilityOff();
- }
- }
+ thePrs->RemoveFromStudy();
}
// Presentation management
ChangeRepresentation (const SalomeApp_Module* theModule,
VISU::PresentationType theType)
{
- SVTK_ViewWindow* vw = GetViewWindow( theModule, false );
- if( !vw )
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+ if (!vw)
return;
Handle(SALOME_InteractiveObject) anIO;
}
}
}
-
+
void
SetShading ( const SalomeApp_Module* theModule,
bool theOn )
{
- SUIT_ViewWindow* aView = GetActiveView(theModule, SVTK_Viewer::Type());
- if (!aView) return;
- SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( aView );
- if( !vw )
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+ if (!vw)
return;
-
+
Handle(SALOME_InteractiveObject) anIO;
CORBA::Object_var anObject = GetSelectedObj(theModule, &anIO);
if (CORBA::is_nil(anObject)) return;
return dynamic_cast<VISU::Result_i*>(VISU::GetServant(anObject).in());
}
- // Views
-
- SUIT_ViewWindow* GetActiveView(const SalomeApp_Module* theModule, QString theType)
- {
- if(SalomeApp_Application* anApp = theModule->getApp()){
- if(SUIT_ViewManager* aViewManager = anApp->activeViewManager()){
- if (!theType.isNull()) {
- if (aViewManager->getType() != theType)
- return 0;
- }
- return aViewManager->getActiveView();
- }
- }
- return 0;
- }
-
// VTK View
- TViewWindows
- GetViews(const SalomeApp_Module* theModule)
- {
- TViewWindows aViewWindows;
- if(SalomeApp_Application* anApp = theModule->getApp()){
- ViewManagerList aViewManagerList;
- anApp->viewManagers(SVTK_Viewer::Type(),aViewManagerList);
- QPtrListIterator<SUIT_ViewManager> anIter(aViewManagerList);
- while(SUIT_ViewManager* aViewManager = anIter.current()){
- QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
- if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
- if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow))
- aViewWindows.push_back(aView);
- }
- ++anIter;
- }
- }
- return aViewWindows;
- }
-
- SVTK_ViewWindow*
- GetViewWindow( const SalomeApp_Module* theModule, const bool theCreate )
- {
- if (SalomeApp_Application* anApp = theModule->getApp())
- {
- SVTK_ViewWindow* wnd = dynamic_cast<SVTK_ViewWindow*>(anApp->desktop()->activeWindow());
- if( wnd )
- return wnd;
- else
- {
- SUIT_ViewManager* aViewManager = anApp->getViewManager( SVTK_Viewer::Type(), theCreate );
- return aViewManager ? dynamic_cast<SVTK_ViewWindow*>( aViewManager->getActiveView() ) : 0;
- }
- }
- return NULL;
- }
-
- /*SVTK_ViewWindow*
- GetViewWindow(const SalomeApp_Module* theModule, const bool theCreate )
- {
- if (SalomeApp_Application* anApp = theModule->getApp())
- {
- SVTK_ViewWindow* wnd = dynamic_cast<SVTK_ViewWindow*>(anApp->desktop()->activeWindow());
- if( wnd )
- return wnd;
- else
- {
- if(SUIT_ViewManager* aViewManager = anApp->getViewManager( SVTK_Viewer::Type(), theCreate ))
- return dynamic_cast<SVTK_ViewWindow*>( aViewManager->getActiveView() );
- }
- }
- return NULL;
- }*/
-
-
- SVTK_ViewWindow*
- GetViewWindow()
- {
- SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
- (SUIT_Session::session()->activeApplication());
- if (anApp) {
- if (SUIT_ViewManager* aViewManager = anApp->activeViewManager()) {
- if (aViewManager->getType() == SVTK_Viewer::Type()) {
- if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) {
- return dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
- }
- }
- }
- }
- return NULL;
- }
-
VISU_Actor*
- PublishInView(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs)
+ PublishMeshInView(const SalomeApp_Module* theModule,
+ VISU::Prs3d_i* thePrs,
+ SVTK_ViewWindow* theViewWindow)
{
VISU_Actor* aActor = NULL;
- if(!thePrs)
+ if (!thePrs || !theViewWindow)
return aActor;
- if(SVTK_ViewWindow* aView = GetViewWindow(theModule)){
- QApplication::setOverrideCursor( Qt::waitCursor );
- try{
- if(aActor = thePrs->CreateActor())
- aView->AddActor(aActor);
- }catch(std::exception& exc){
- SUIT_MessageBox::warn1
- (GetDesktop(theModule), QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()),
- QObject::tr("BUT_OK"));
- }
- QApplication::restoreOverrideCursor();
- }
- return aActor;
- }
- VISU_Actor*
- UpdateViewer(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs,
- bool theDispOnly)
- {
- SVTK_ViewWindow* vw = GetViewWindow( theModule );
- if (!vw) return NULL;
-
- vtkRenderer *aRen = vw->getRenderer();
- vtkActorCollection *anActColl = aRen->GetActors();
- anActColl->InitTraversal();
-
- vtkActor *anActor;
- VISU_Actor* anVISUActor = NULL;
- VISU_Actor* aResActor = NULL;
- while(vtkActor *anActor = anActColl->GetNextActor()){
- anVISUActor = VISU_Actor::SafeDownCast(anActor);
- if(anVISUActor){
- VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d();
- if(aPrs == NULL) continue;
- if (thePrs == aPrs) {
- try {
- aResActor = anVISUActor;
- thePrs->UpdateActor(aResActor);
- aResActor->VisibilityOn();
- } catch (std::runtime_error& exc) {
- aResActor->VisibilityOff();
- INFOS(exc.what());
- SUIT_MessageBox::warn1
- (GetDesktop(theModule), QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()),
- QObject::tr("BUT_OK"));
- }
- } else if (theDispOnly) {
- anVISUActor->VisibilityOff();
- } else {
- }
- } else if (theDispOnly && anActor->GetVisibility()) {
- anActor->VisibilityOff();
- } else {
- }
+ QApplication::setOverrideCursor( Qt::waitCursor );
+ try {
+ if ((aActor = thePrs->CreateActor()))
+ theViewWindow->AddActor(aActor);
+ } catch(std::exception& exc) {
+ SUIT_MessageBox::warn1
+ (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()),
+ QObject::tr("BUT_OK"));
}
- if (aResActor)
- return aResActor;
+ QApplication::restoreOverrideCursor();
- //anVISUActor = PublishInView( theModule, thePrs );
- return anVISUActor;
+ return aActor;
}
void
QApplication::restoreOverrideCursor();
}
- static bool ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow,
- float allBounds[6],
- const char* theActorClassName = "VISU_Actor")
+ static
+ bool
+ ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow,
+ vtkFloatingPointType allBounds[6],
+ const char* theActorClassName = "VISU_Actor")
{
vtkRenderer *aRen = theViewWindow->getRenderer();
vtkActorCollection *anActColl = aRen->GetActors();
vtkProp *prop;
- float *bounds;
- int somethingVisible = false;
+ vtkFloatingPointType *bounds;
+ int somethingVisible = false;
allBounds[0] = allBounds[2] = allBounds[4] = VTK_LARGE_FLOAT;
allBounds[1] = allBounds[3] = allBounds[5] = -VTK_LARGE_FLOAT;
void SetFitAll(SVTK_ViewWindow* theViewWindow)
{
- static float PRECISION = 0.000001;
- static float DEVIATION = 600;
- float XYZ_Bnd[6];
+ static vtkFloatingPointType PRECISION = 0.000001;
+ static vtkFloatingPointType DEVIATION = 600;
+ vtkFloatingPointType XYZ_Bnd[6];
if (!ComputeVisiblePropBounds(theViewWindow, XYZ_Bnd)) return;
- float absX = XYZ_Bnd[1] - XYZ_Bnd[0];
- float absY = XYZ_Bnd[3] - XYZ_Bnd[2];
- float absZ = XYZ_Bnd[5] - XYZ_Bnd[4];
+ vtkFloatingPointType absX = XYZ_Bnd[1] - XYZ_Bnd[0];
+ vtkFloatingPointType absY = XYZ_Bnd[3] - XYZ_Bnd[2];
+ vtkFloatingPointType absZ = XYZ_Bnd[5] - XYZ_Bnd[4];
enum CameraOrient {e3D, eFront, eLeft, eTop};
CameraOrient aCameraOrient = e3D;
if (absZ <= PRECISION) aCameraOrient = eTop;
else {
// all the three dimensions exceeds precision
- float dev_abs_XY = absX / absY;
- float dev_abs_YZ = absY / absZ;
- float dev_abs_XZ = absX / absZ;
+ vtkFloatingPointType dev_abs_XY = absX / absY;
+ vtkFloatingPointType dev_abs_YZ = absY / absZ;
+ vtkFloatingPointType dev_abs_XZ = absX / absZ;
if (dev_abs_XY >= DEVIATION || 1./dev_abs_YZ >= DEVIATION)
aCameraOrient = eLeft;
else {
aPlot->Repaint();
}
+ void
+ PlotRemoveCurve(const SalomeApp_Module* theModule,
+ VISU::Curve_i* pCrv)
+ {
+ QString anEntry = pCrv->GetEntry();
+ ViewManagerList pvm_list;
+ theModule->getApp()->viewManagers( SPlot2d_Viewer::Type(), pvm_list );
+ for( SUIT_ViewManager* mgr = pvm_list.first(); mgr; mgr = pvm_list.next() ){
+ Plot2d_ViewManager* pvm = dynamic_cast<Plot2d_ViewManager*>( mgr );
+ if( pvm ){
+ SPlot2d_Viewer* aSPlot2d = dynamic_cast<SPlot2d_Viewer*>( pvm->getViewModel() );
+ if( aSPlot2d ){
+ Plot2d_ViewFrame* aPlot = aSPlot2d->getActiveViewFrame();
+ if(aPlot){
+ QList<Plot2d_Curve> clist;
+ aPlot->getCurves( clist );
+ for (int i = 0; i < clist.count(); i++) {
+ if(SPlot2d_Curve* plotCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i)))
+ if(plotCurve->hasIO() && (plotCurve->getIO()->getEntry() == anEntry))
+ aPlot->eraseCurve(clist.at(i));
+ }
+ }
+ }
+ }
+ }
+ }
+
void
PlotContainer(const SalomeApp_Module* theModule,
VISU::Container_i* container,
// Others
void CreateMesh (const SalomeApp_Module* theModule,
- const Handle(SALOME_InteractiveObject)& theIO)
+ const Handle(SALOME_InteractiveObject)& theIO,
+ SVTK_ViewWindow* theViewWindow)
{
_PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule));
//if (CheckLock(aStudy))
timer.Show();
#endif
- QApplication::restoreOverrideCursor();
+ //QApplication::restoreOverrideCursor();
VISU::Mesh_i* pPresent = NULL;
if (!CORBA::is_nil(aMesh))
pPresent = dynamic_cast<VISU::Mesh_i*>(VISU::GetServant(aMesh).in());
return;
}
- if (SVTK_ViewWindow* aView = GetViewWindow(theModule)) {
+ if (theViewWindow) {
try {
#ifdef CHECKTIME
Utils_Timer timer;
timer.Start();
#endif
- PublishInView(theModule, pPresent);
- //aView->onFitAll();
- SetFitAll(aView);
+ PublishMeshInView(theModule, pPresent, theViewWindow);
+ SetFitAll(theViewWindow);
#ifdef CHECKTIME
timer.Stop();
MESSAGE("VisuGUI::CreateMesh() - DISPLAY MESH");
timer.Show();
#endif
- theModule->application()->putInfo(QObject::tr("INF_DONE"));
- // Make "Save" button active
- theModule->getApp()->updateActions();
} catch (std::runtime_error& exc) {
INFOS(exc.what());
SUIT_MessageBox::warn1
QObject::tr("BUT_OK"));
}
}
+
+ theModule->application()->putInfo(QObject::tr("INF_DONE"));
+ // Make "Save" button active
+ theModule->getApp()->updateActions();
}
// ========================================================================================
}
return aList;
}
-
- int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule){
+
+ int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow)
+ {
int minIndx = 1;
std::set<int> aIndexes;
- SVTK_ViewWindow* vw = GetViewWindow(theModule);
TViewToPrs3d aMap = theModule->getScalarBarsMap();
- TViewToPrs3d::const_iterator aViewToPrsIter = aMap.find(vw);
- if (aViewToPrsIter != aMap.end()){
+ TViewToPrs3d::const_iterator aViewToPrsIter = aMap.find(theViewWindow);
+ if (aViewToPrsIter != aMap.end()) {
TSetPrs3d::const_iterator aPrsIter = (aViewToPrsIter->second).begin();
- for(;aPrsIter!=(aViewToPrsIter->second).end();aPrsIter++){
+ for (; aPrsIter != (aViewToPrsIter->second).end(); aPrsIter++) {
aIndexes.insert((*aPrsIter).second);
}
}
std::set<int>::const_iterator aIter = aIndexes.begin();
- for (int i=1,length=aIndexes.size(); i <= length; i++){
+ for (int i = 1,length = aIndexes.size(); i <= length; i++) {
std::set<int>::const_iterator aIter = aIndexes.find(i);
- if(aIter==aIndexes.end()){minIndx = i;break;}
+ if (aIter == aIndexes.end()) { minIndx = i; break; }
else minIndx = i + 1;
-
}
return minIndx;
}
-
- void AddScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d, int pos){
- SVTK_ViewWindow* vw = GetViewWindow(theModule);
+
+ void AddScalarBarPosition (VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
+ VISU::Prs3d_i* thePrs3d, int pos)
+ {
TViewToPrs3d& aMap = theModule->myScalarBarsMap;
- TPrs3dToInd aPair; aPair.first=thePrs3d; aPair.second=pos;
- aMap[vw].insert(aPair);
+ TPrs3dToInd aPair; aPair.first = thePrs3d; aPair.second = pos;
+ aMap[theViewWindow].insert(aPair);
}
-
- void RemoveScalarBarPosition(VisuGUI* theModule,SVTK_ViewWindow* vw,VISU::Prs3d_i* thePrs3d){
+
+ void RemoveScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
+ VISU::Prs3d_i* thePrs3d)
+ {
TViewToPrs3d& aMap = theModule->myScalarBarsMap;
- TSetPrs3d::iterator aIter = aMap[vw].begin();
- for(;aIter!=aMap[vw].end();aIter++)
- if((*aIter).first == thePrs3d){
- aMap[vw].erase(*aIter);
+ TSetPrs3d::iterator aIter = aMap[theViewWindow].begin();
+ for (; aIter != aMap[theViewWindow].end(); aIter++)
+ if ((*aIter).first == thePrs3d) {
+ aMap[theViewWindow].erase(*aIter);
return;
}
}
-
- void RemoveScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d){
- SVTK_ViewWindow* vw = GetViewWindow(theModule);
- RemoveScalarBarPosition(theModule,vw,thePrs3d);
- }
-
- void RemoveScalarBarPosition(VisuGUI* theModule,CORBA::Object_ptr theObject){
- if (!CORBA::is_nil(theObject)) {
- Base_var aBase = Base::_narrow(theObject);
- if (CORBA::is_nil(aBase)) return;
- if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aBase).in())){
- RemoveScalarBarPosition(theModule,aPrsObject);
- }
- }
- }
}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
bool IsRemovableSelected(const SalomeApp_Module* theModule);
- // Display/Erase
- void ErasePrs(const SalomeApp_Module* theModule,
- CORBA::Object_ptr theObject,
- bool theUpdate = true);
void DeleteSObject(VisuGUI* theModule,
_PTR(Study) theStudy,
_PTR(SObject) theSObject);
void DeletePrs3d(VisuGUI* theModule,
VISU::Prs3d_i* thePrs,
const Handle(SALOME_InteractiveObject)& theIO);
- void ErasePrs3d(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs);
// Presentation management
void ChangeRepresentation (const SalomeApp_Module* theModule,
VISU::Result_var& theResult);
bool IsSObjectTable(_PTR(SObject) theSObject);
- // Views
- SUIT_ViewWindow* GetActiveView(const SalomeApp_Module* theModule,
- QString theType = QString::null);
-
- // VTK View
- TViewWindows GetViews(const SalomeApp_Module* theModule);
- SVTK_ViewWindow* GetViewWindow(const SalomeApp_Module* theModule,
- const bool theCreate = false );
- SVTK_ViewWindow* GetViewWindow();
-
- VISU_Actor* PublishInView(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs);
- VISU_Actor* UpdateViewer(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs,
- bool theDispOnly = false);
+ /*! Display mesh presentation in given VTK view window
+ */
+ VISU_Actor* PublishMeshInView(const SalomeApp_Module* theModule,
+ VISU::Prs3d_i* thePrs,
+ SVTK_ViewWindow* theViewWindow);
/*!
* \brief Repaint all SVTK view windows, where the given object is displayed.
void PlotCurve( const SalomeApp_Module* theModule,
VISU::Curve_i* curve,
int theDisplaying );
+ void PlotRemoveCurve(const SalomeApp_Module* theModule,
+ VISU::Curve_i* curve);
void PlotContainer( const SalomeApp_Module* theModule,
VISU::Container_i* container,
int theDisplaying );
void CreatePlot( SalomeApp_Module* theModule,
_PTR(SObject) theSobj );
+ /*! Display/Erase/Update a curve presentation.
+ * Parameter \a frame may be NULL, in this case there is only update without display/erase
+ */
void UpdateCurve( VISU::Curve_i*,
Plot2d_ViewFrame* frame,
SPlot2d_Curve*,
int theDisplaying );
- //parameter frame may be 0, in this case there is only update without display/erase
- // Others
+ /*! Create mesh presentation and display it in \a theViewWindow.
+ * If \a theViewWindow is NULL, no displaying will be done.
+ */
void CreateMesh (const SalomeApp_Module* theModule,
- const Handle(SALOME_InteractiveObject)& theIO);
+ const Handle(SALOME_InteractiveObject)& theIO,
+ SVTK_ViewWindow* theViewWindow = NULL);
+ // Others
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
const Handle(SALOME_InteractiveObject)& theIO);
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
_PTR(SObject) theObject);
- int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule);
- void AddScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d, int pos);
- void RemoveScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d);
- void RemoveScalarBarPosition(VisuGUI* theModule,SVTK_ViewWindow* vw,VISU::Prs3d_i* thePrs3d);
- void RemoveScalarBarPosition(VisuGUI* theModule,CORBA::Object_ptr theObject);
+ int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow);
+ void AddScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
+ VISU::Prs3d_i* thePrs3d, int pos);
+ void RemoveScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
+ VISU::Prs3d_i* thePrs3d);
}
#endif
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "SUIT_Desktop.h"
#include "SUIT_OverrideCursor.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
#include "SALOME_ListIO.hxx"
#include "SALOME_ListIteratorOfListIO.hxx"
#include "LightApp_Study.h"
#include "LightApp_SelectionMgr.h"
+#include "LightApp_Application.h"
#include "SVTK_ViewWindow.h"
: QDialog( VISU::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | WDestructiveClose ),
mySelectionMgr( VISU::GetSelectionMgr( theModule ) ),
- myViewWindow( VISU::GetViewWindow( theModule ) )
+ myViewWindow( VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule) )
{
if (!name)
setName("VisuGUI_TransparencyDlg");
buttonOk->setText(tr("BUT_CLOSE"));
buttonOk->setAutoDefault(TRUE);
buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 0);
- GroupButtonsLayout->addWidget(buttonOk, 0, 1);
- GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2);
+
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("BUT_HELP"));
+ buttonHelp->setAutoDefault(TRUE);
+
+ GroupButtonsLayout->addWidget(buttonOk, 0, 0);
+ GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 2);
VisuGUI_TransparencyDlgLayout->addWidget(GroupC1, 0, 0);
VisuGUI_TransparencyDlgLayout->addWidget(GroupButtons, 1, 0);
// signals and slots connections : after ValueHasChanged()
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(Slider1, SIGNAL(valueChanged(int)), this, SLOT(SetTransparency()));
connect(Slider1, SIGNAL(sliderMoved(int)), this, SLOT(ValueHasChanged()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged()));
close();
}
+//=======================================================================
+// function : ClickOnHelp()
+// purpose :
+//=======================================================================
+void VisuGUI_TransparencyDlg::ClickOnHelp()
+{
+ QString aHelpFileName = "/files/changing_visualization_parameters_of_the_presenetation.htm#Changing3";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+ app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ }
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
+
//=================================================================================
// function : SetTransparency()
// purpose : Called when value of slider change
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
SVTK_ViewWindow* myViewWindow;
QPushButton* buttonOk;
+ QPushButton* buttonHelp;
QLabel* TextLabelOpaque;
QLabel* ValueLab;
QLabel* TextLabelTransparent;
public slots:
void ClickOnOk();
+ void ClickOnHelp();
void ValueHasChanged();
void SetTransparency();
void onSelectionChanged();
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "VisuGUI_Tools.h"
#include "VISU_Vectors_i.hh"
-
+#include "LightApp_Application.h"
#include "SalomeApp_Module.h"
+
#include "SUIT_Desktop.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
#include <qlayout.h>
#include <qcolordialog.h>
buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" );
buttonCancel->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
+ buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" );
+ buttonHelp->setAutoDefault( TRUE );
+ GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
// top layout
aTabBox->addTab(aBox, "Vectors");
connect( UseMagn, SIGNAL( clicked() ), this, SLOT( enableSetColor() ) );
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
// default values
UseMagn->setChecked( TRUE );
myScalarPane->deletePreview();
QDialog::reject();
}
+
+void VisuGUI_VectorsDlg::onHelp()
+{
+ QString aHelpFileName = "/files/vectors_presentation.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+ app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+ }
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
protected slots:
void accept();
void reject();
+ void onHelp();
private:
QGroupBox* TopGroup;
QGroupBox* GroupButtons;
QPushButton* buttonOk;
QPushButton* buttonCancel;
+ QPushButton* buttonHelp;
QColor myColor;
VisuGUI_ScalarBarPane* myScalarPane;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
{
void
ErasePrs(VisuGUI* theModule,
- VISU::Base_ptr theBase,
- bool thIsUpdate)
+ CORBA::Object_ptr theObject,
+ bool theDoRepaintVW)
{
- VISU::VISUType aType = theBase->GetType();
+ if (CORBA::is_nil(theObject)) return;
+ VISU::Base_var aBase = VISU::Base::_narrow(theObject);
+ if (CORBA::is_nil(aBase)) return;
+
+ VISU::VISUType aType = aBase->GetType();
switch (aType) {
case VISU::TCURVE: {
- if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(theBase).in()))
+ if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aBase).in()))
PlotCurve(theModule, aCurve, VISU::eErase );
break;
}
case VISU::TCONTAINER: {
- if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(theBase).in()))
+ if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aBase).in()))
PlotContainer(theModule, aContainer, VISU::eErase );
break;
}
case VISU::TTABLE: {
- if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(theBase).in()))
+ if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aBase).in()))
PlotTable(theModule, aTable, VISU::eErase );
break;
}
default: {
- if(VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(theBase).in())){
- if(aType == VISU::TGAUSSPOINTS)
- ErasePrs3d<VVTK_Viewer>(theModule,aPrsObject,thIsUpdate);
- else if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){
- QString aType = aViewManager->getType();
- if(aType == SVTK_Viewer::Type())
- ErasePrs3d<SVTK_Viewer>(theModule,aPrsObject,thIsUpdate);
- else if(aType == VVTK_Viewer::Type())
- ErasePrs3d<VVTK_Viewer>(theModule,aPrsObject,thIsUpdate);
- }
+ if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aBase).in())) {
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+ RemoveScalarBarPosition(theModule, vw, aPrsObject);
+ ErasePrs3d(theModule, aPrsObject, theDoRepaintVW);
}
}} // switch (aType)
}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "VisuGUI.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_ViewManager.h"
-#include "SUIT_ViewWindow.h"
+#include "VisuGUI_Tools.h"
+
+#include "VISU_Prs3d_i.hh"
+#include "VISU_Table_i.hh"
+#include "VISU_ViewManager_i.hh"
+
+#include "VISU_Actor.h"
#include "SalomeApp_Module.h"
#include "SalomeApp_Application.h"
-#include "VISU_Prs3d_i.hh"
-
#include "VVTK_ViewModel.h"
#include "VVTK_ViewWindow.h"
+#include "SVTK_Functor.h"
#include "SVTK_ViewModel.h"
#include "SVTK_ViewWindow.h"
-#include "VisuGUI_Tools.h"
+#include "SPlot2d_ViewModel.h"
+
#include "VTKViewer_Algorithm.h"
-#include "SVTK_Functor.h"
-#include "VISU_Table_i.hh"
-#include "VISU_ViewManager_i.hh"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ViewManager.h"
+#include "SUIT_ViewWindow.h"
+
#include "SALOME_ListIO.hxx"
#include "SALOME_ListIteratorOfListIO.hxx"
-#include "SPlot2d_ViewModel.h"
-
-#include "VISU_Actor.h"
-
#include <vtkActorCollection.h>
#include <vtkRenderer.h>
namespace VISU
{
- //---------------------------------------------------------------
+ /*! Return active view window, if it instantiates TViewer::TViewWindow class,
+ * overwise find or create corresponding view window, make it active and return it.
+ * \note Active VVTK_ViewWindow can be returned by request GetViewWindow<SVTK_Viewer>(),
+ * because VVTK_ViewWindow inherits SVTK_ViewWindow.
+ */
template<class TViewer>
inline
typename TViewer::TViewWindow*
- GetViewWindow(VisuGUI* theModule,
- const bool theIsViewCreate = false)
+ GetViewWindow(VisuGUI* theModule)
{
- typedef typename TViewer::TViewWindow TView;
- if(SUIT_ViewManager* aViewManager = theModule->getViewManager(TViewer::Type(),theIsViewCreate)){
- if(SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()){
- if(TView* aView = dynamic_cast<TView*>(aViewWindow)){
+ typedef typename TViewer::TViewWindow TViewWindow;
+ if (SalomeApp_Application* anApp = theModule->getApp()) {
+ if (TViewWindow* aView = dynamic_cast<TViewWindow*>(anApp->desktop()->activeWindow()))
+ return aView;
+ }
+ SUIT_ViewManager* aViewManager =
+ theModule->getViewManager(TViewer::Type(), /*create = */true);
+ if (aViewManager) {
+ if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) {
+ if (TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow)) {
aViewWindow->raise();
aViewWindow->setFocus();
return aView;
return NULL;
}
+ /*! Return active view window, if it instantiates TViewWindow class, overwise return NULL.
+ * \note Active VVTK_ViewWindow can be returned by request GetActiveViewWindow<SVTK_ViewWindow>(),
+ * because VVTK_ViewWindow inherits SVTK_ViewWindow.
+ */
+ template<class TViewWindow>
+ inline
+ TViewWindow*
+ GetActiveViewWindow(const SalomeApp_Module* theModule = NULL)
+ {
+ SalomeApp_Application* anApp = NULL;
+ if (theModule)
+ anApp = theModule->getApp();
+ else
+ anApp = dynamic_cast<SalomeApp_Application*>
+ (SUIT_Session::session()->activeApplication());
+
+ if (anApp)
+ if (SUIT_ViewManager* aViewManager = anApp->activeViewManager())
+ if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView())
+ return dynamic_cast<TViewWindow*>(aViewWindow);
+
+ return NULL;
+ }
+
//---------------------------------------------------------------
- template<class TViewer>
inline
VISU_Actor*
PublishInView(VisuGUI* theModule,
Prs3d_i* thePrs,
- const bool theIsHighlight = false,
- const bool theIsCreateView = false)
+ SVTK_ViewWindow* theViewWindow,
+ const bool theIsHighlight = false)
{
- typedef typename TViewer::TViewWindow TView;
- if(TView* aView = GetViewWindow<TViewer>(theModule,theIsCreateView)){
+ if (theViewWindow) {
QApplication::setOverrideCursor( Qt::waitCursor );
try {
- if(VISU_Actor* anActor = thePrs->CreateActor()){
- aView->AddActor(anActor);
- if(theIsHighlight)
- aView->highlight(anActor->getIO(),true);
- aView->getRenderer()->ResetCameraClippingRange();
- aView->Repaint();
+ if (VISU_Actor* anActor = thePrs->CreateActor()) {
+ theViewWindow->AddActor(anActor);
+ if (theIsHighlight)
+ theViewWindow->highlight(anActor->getIO(),true);
+ theViewWindow->getRenderer()->ResetCameraClippingRange();
+ theViewWindow->Repaint();
QApplication::restoreOverrideCursor();
return anActor;
}
} catch(std::exception& exc) {
+ thePrs->RemoveActors();
+
QApplication::restoreOverrideCursor();
INFOS(exc.what());
SUIT_MessageBox::warn1
//---------------------------------------------------------------
- template<class TViewer>
inline
VISU_Actor*
UpdateViewer(VisuGUI* theModule,
VISU::Prs3d_i* thePrs,
bool theDispOnly = false,
- const bool theIsHighlight = false,
- const bool theIsViewCreate = false)
+ const bool theIsHighlight = false)
{
- typedef typename TViewer::TViewWindow TView;
- if(TView* aView = GetViewWindow<TViewer>(theModule,theIsViewCreate)){
- vtkRenderer *aRen = aView->getRenderer();
+ if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)) {
+ vtkRenderer *aRen = aViewWindow->getRenderer();
vtkActorCollection *anActColl = aRen->GetActors();
anActColl->InitTraversal();
VISU_Actor* aResActor = NULL;
- while(vtkActor *anAct = anActColl->GetNextActor()){
- if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)){
- if(VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d()){
- if(thePrs == aPrs3d){
+ bool isOk = true;
+ while (vtkActor *anAct = anActColl->GetNextActor()) {
+ if (VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)) {
+ if (VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d()) {
+ if (thePrs == aPrs3d) {
try {
+ aResActor = anActor;
thePrs->UpdateActors();
+ aResActor->VisibilityOn();
} catch (std::runtime_error& exc) {
+ thePrs->RemoveActors();
+ isOk = false;
+
INFOS(exc.what());
- QApplication::restoreOverrideCursor();
SUIT_MessageBox::warn1
(GetDesktop(theModule), QObject::tr("WRN_VISU"),
QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()),
QObject::tr("BUT_OK"));
-
- thePrs->RemoveActors();
- return NULL;
}
- aResActor = anActor;
- aResActor->VisibilityOn();
- }else if(theDispOnly){
+ } else if (theDispOnly) {
anActor->VisibilityOff();
}
- }else if(theDispOnly && anActor->GetVisibility()){
+ } else if (theDispOnly && anActor->GetVisibility()) {
anActor->VisibilityOff();
}
}
}
- if(aResActor){
- if(theIsHighlight)
- aView->highlight(aResActor->getIO(),true);
- aView->getRenderer()->ResetCameraClippingRange();
- aView->Repaint();
+ if (aResActor) {
+ if (theIsHighlight && isOk)
+ aViewWindow->highlight(aResActor->getIO(), true);
+ aViewWindow->getRenderer()->ResetCameraClippingRange();
+ aViewWindow->Repaint();
return aResActor;
}
- return PublishInView<TViewer>(theModule,thePrs,theIsHighlight,theIsViewCreate);
+ return PublishInView(theModule, thePrs, aViewWindow, theIsHighlight);
}
return NULL;
}
OnEraseAll(VisuGUI* theModule)
{
typedef typename TViewer::TViewWindow TViewWindow;
- if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule)){
+ if (TViewWindow* aViewWindow = GetActiveViewWindow<TViewWindow>(theModule)) {
aViewWindow->unHighlightAll();
- if(vtkRenderer *aRen = aViewWindow->getRenderer()){
+ if (vtkRenderer *aRen = aViewWindow->getRenderer()) {
vtkActorCollection *aCollection = aRen->GetActors();
aCollection->InitTraversal();
- while(vtkActor *anAct = aCollection->GetNextActor()){
- if(anAct->GetVisibility() > 0)
- if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)){
+ while (vtkActor *anAct = aCollection->GetNextActor()) {
+ if (anAct->GetVisibility() > 0)
+ if (SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)) {
anActor->VisibilityOff();
}
}
}
}
}
-
+
template<>
inline
void
OnEraseAll<SPlot2d_Viewer>(VisuGUI* theModule)
{
- if(SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(theModule,false))
+ if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(theModule, false))
aPlot2d->EraseAll();
}
//---------------------------------------------------------------
- template<class TVieweWindow>
- inline
- VISU_Actor*
- FindActor(TVieweWindow* theViewWindow,
- const char* theEntry)
- {
- using namespace SVTK;
- if(vtkRenderer* aRenderer = theViewWindow->getRenderer()){
- if(vtkActorCollection* aCollection = aRenderer->GetActors()){
- if(VISU_Actor* anActor = Find<VISU_Actor>(aCollection,TIsSameEntry<VISU_Actor>(theEntry))){
- return anActor;
- }
- }
- }
- return NULL;
- }
-
- template<class TViewer>
inline
void
ErasePrs3d(VisuGUI* theModule,
VISU::Prs3d_i* thePrs,
- const bool thIsUpdate = true)
+ const bool theDoRepaintVW = true)
{
- typedef typename TViewer::TViewWindow TViewWindow;
- if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule)){
- if(VISU_Actor* anActor = FindActor(aViewWindow,thePrs)){
+ if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)) {
+ if (VISU_Actor* anActor = FindActor(aViewWindow, thePrs)) {
anActor->VisibilityOff();
- if(thIsUpdate)
+ if (theDoRepaintVW)
aViewWindow->Repaint();
}
}
}
-
void
ErasePrs(VisuGUI* theModule,
- VISU::Base_ptr theBase,
- bool thIsUpdate);
+ CORBA::Object_ptr theObject,
+ bool theDoRepaintVW);
}
#endif
-# Copyright (C) 2003 CEA/DEN, EDF R&D
-#
-#
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : Makefile.in
# Author : Alexey Petrov
# Module : VISU
-# $Header:
top_srcdir=@top_srcdir@
top_builddir=../..
srcdir=@srcdir@
VPATH=.:@srcdir@:@top_srcdir@/idl
-
+BOOST_LIBSUFFIX=@BOOST_LIBSUFFIX@
@COMMENCE@
$(HDF5_INCLUDES) \
$(QWT_INCLUDES) \
$(BOOST_CPPFLAGS)\
- -I${KERNEL_ROOT_DIR}/include/salome \
- -I${MED_ROOT_DIR}/include/salome \
- -I${GUI_ROOT_DIR}/include/salome
+ $(KERNEL_CXXFLAGS) \
+ $(MED_CXXFLAGS) \
+ $(GUI_CXXFLAGS)
LDFLAGS += \
$(PYTHON_LIBS) \
$(VTK_LIBS) \
$(QWT_LIBS) \
$(BOOST_LIBS) \
- -L${KERNEL_ROOT_DIR}/lib/salome \
- -L${GUI_ROOT_DIR}/lib/salome \
- -L${MED_ROOT_DIR}/lib/salome
+ $(KERNEL_LDFLAGS) \
+ $(GUI_LDFLAGS) \
+ $(MED_LDFLAGS)
-LIBS+= -lboost_signals-mt \
+LIBS+= -lboost_signals${BOOST_LIBSUFFIX} \
-lSalomeHDFPersist \
-lSalomeGenericObj \
-lSalomeContainer \
-lTOOLSDS \
-lOpUtil \
-lEvent \
- -lCASCatch \
-lSalomeApp \
-lSalomeSession \
-lVTKViewer \
-lVisuConvertor \
-lVisuPipeLine \
-lVisuObject \
+ -lVVTK \
-lVISUGUITOOLS
LDFLAGSFORBIN=$(LDFLAGS) $(LIBS) \
- -L${KERNEL_ROOT_DIR}/lib/salome \
+ $(KERNEL_LDFLAGS) \
-lSALOMEBasics \
-lSalomeCatalog \
-lwith_loggerTraceCollector \
-lSalomeNotification \
-lSALOMELocalTrace \
-lSalomeResourcesManager \
- -lSalomeDS \
- -lSalomeDSImpl \
+ -lSalomeDSClient \
-lSalomeObject \
-lqtx \
-lsuit \
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISUConfig.cc
}
+ QString Storable::FindValue(const TRestoringMap& theMap, const string& theArg, const QString& theDefaultValue)
+ {
+ bool anIsFound = false;
+ QString aValue = FindValue(theMap,theArg,&anIsFound);
+ if(anIsFound)
+ return aValue;
+ return theDefaultValue;
+ }
+
+
//===========================================================================
PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject){
if(CORBA::is_nil(theObject)) return NULL;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISUConfig.hh
static void Registry(const char* theComment, TStorableEngine theEngine);
static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString);
static QString FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL);
+ static QString FindValue(const TRestoringMap& theMap, const std::string& theArg, const QString& theDefaultValue);
static void StrToMap(const QString& theStr, VISU::Storable::TRestoringMap& theMap);
static SALOMEDS::SObject_ptr GetResultSO(SALOMEDS::SObject_ptr theSObject);
static void DataToStream(std::ostringstream& theStr, const QString& theName, const QString& theVal);
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.cxx
myField = anOrigin->GetField();
myMeshName = myField->myMeshName;
- myEntity = myField->myEntity;
+ myEntity = VISU::TEntity(anOrigin->GetEntity());//myField->myEntity;
myIteration = anOrigin->GetIteration();
myFieldName = anOrigin->GetFieldName();
SetItalicTitle(anOrigin->IsItalicTitle());
SetShadowTitle(anOrigin->IsShadowTitle());
SetTitFontType(anOrigin->GetTitFontType());
- float r,g,b;
+ vtkFloatingPointType r,g,b;
anOrigin->GetTitleColor(&r,&g,&b);
SetTitleColor(r,g,b);
void
VISU::ColoredPrs3d_i
-::GetTitleColor(float* theR, float* theG, float* theB)
+::GetTitleColor(vtkFloatingPointType* theR,
+ vtkFloatingPointType* theG,
+ vtkFloatingPointType* theB)
{
*theR = myTitleColor[0];
*theG = myTitleColor[1];
void
VISU::ColoredPrs3d_i
-::SetTitleColor(float theR, float theG, float theB)
+::SetTitleColor(vtkFloatingPointType theR,
+ vtkFloatingPointType theG,
+ vtkFloatingPointType theB)
{
myTitleColor[0] = theR;
myTitleColor[1] = theG;
void
VISU::ColoredPrs3d_i
-::GetLabelColor(float* theR, float* theG, float* theB)
+::GetLabelColor(vtkFloatingPointType* theR,
+ vtkFloatingPointType* theG,
+ vtkFloatingPointType* theB)
{
*theR = myLabelColor[0];
*theG = myLabelColor[1];
void
VISU::ColoredPrs3d_i
-::SetLabelColor(float theR, float theG, float theB)
+::SetLabelColor(vtkFloatingPointType theR,
+ vtkFloatingPointType theG,
+ vtkFloatingPointType theB)
{
myLabelColor[0] = theR;
myLabelColor[1] = theG;
// Scalar Bar origin
QString propertyName = QString( "scalar_bar_%1_" ).arg( anOrientation == 0 ? "vertical" : "horizontal" );
- float aXorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.01 : 0.2;
+ vtkFloatingPointType aXorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.01 : 0.2;
aXorigin = aResourceMgr->doubleValue("VISU", propertyName + "x", aXorigin);
myPosition[0] = aXorigin;
- float aYorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.1 : 0.012;
+ vtkFloatingPointType aYorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.1 : 0.012;
aYorigin = aResourceMgr->doubleValue("VISU", propertyName + "y", aYorigin);
myPosition[1] = aYorigin;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.hxx
VISU::ScalarMap::Orientation myOrientation;
std::string myTitle;
int myNumberOfLabels;
- float myPosition[2], myWidth, myHeight;
+ vtkFloatingPointType myPosition[2], myWidth, myHeight;
public:
//----------------------------------------------------------------------------
void
SameAsParams(const ColoredPrs3d_i* theOrigin);
- const VISU::PField&
+ virtual const VISU::PField&
GetField() const;
const std::string&
virtual
void
- GetTitleColor(float* theR, float* theG, float* theB);
+ GetTitleColor(vtkFloatingPointType* theR,
+ vtkFloatingPointType* theG,
+ vtkFloatingPointType* theB);
virtual
void
- SetTitleColor(float theR, float theG, float theB);
+ SetTitleColor(vtkFloatingPointType theR,
+ vtkFloatingPointType theG,
+ vtkFloatingPointType theB);
virtual
bool
virtual
void
- GetLabelColor(float* theR, float* theG, float* theB);
+ GetLabelColor(vtkFloatingPointType* theR,
+ vtkFloatingPointType* theG,
+ vtkFloatingPointType* theB);
virtual
void
- SetLabelColor(float theR, float theG, float theB);
+ SetLabelColor(vtkFloatingPointType theR,
+ vtkFloatingPointType theG,
+ vtkFloatingPointType theB);
//----------------------------------------------------------------------------
protected:
bool myIsItalicTitle;
bool myIsShadowTitle;
int myTitFontType;
- float myTitleColor[3];
+ vtkFloatingPointType myTitleColor[3];
bool myIsBoldLabel;
bool myIsItalicLabel;
bool myIsShadowLabel;
int myLblFontType;
- float myLabelColor[3];
+ vtkFloatingPointType myLabelColor[3];
VISU_ScalarMapPL* myScalarMapPL;
bool myIsFixedRange;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
if(theFamily->myIsDone)
return 0;
- const VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
SALOME_MED::FAMILY_var aMedFamily = theFamily->myFamily;
CORBA::Boolean anIsOnAllElements = aMedFamily->isOnAllElements();
if(!anIsOnAllElements){
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.cxx
#include "VISU_Convertor.hxx"
#include "VISU_PipeLineUtils.hxx"
+#include "SUIT_ResourceMgr.h"
+
#include <vtkAppendPolyData.h>
using namespace VISU;
using namespace std;
-static float EPS_machine = 1.0E-7;
+static vtkFloatingPointType EPS_machine = 1.0E-7;
#ifdef _DEBUG_
static int MYDEBUG = 0;
{
if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
anActor->SetVTKMapping(true);
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aDispMode = aResourceMgr->integerValue("VISU" , "cut_lines_represent", 2);
+ anActor->SetRepresentation(aDispMode);
return anActor;
}
return NULL;
anAttr = aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributeTableOfReal");
SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
- typedef set<float> TXCont;
- typedef map<float,float> TXYMap;
+ typedef set<vtkFloatingPointType> TXCont;
+ typedef map<vtkFloatingPointType,vtkFloatingPointType> TXYMap;
typedef map<int,TXYMap> TXYMapCont;
typedef map<long,long> TLineIdCont;
TXCont aXCont;
TXYMapCont aXYMapCont;
TLineIdCont aLineIdCont; // Define internal numeration of lines
- const float *aDirLn = myCutLinesPL->GetDirLn();
- const float *aBasePnt = myCutLinesPL->GetBasePnt();
- const float *aBoundPrjLn = myCutLinesPL->GetBoundPrjLn();
+ const vtkFloatingPointType *aDirLn = myCutLinesPL->GetDirLn();
+ const vtkFloatingPointType *aBasePnt = myCutLinesPL->GetBasePnt();
+ const vtkFloatingPointType *aBoundPrjLn = myCutLinesPL->GetBoundPrjLn();
for(int iLine = 0, jLine = 0; iLine < iLineEnd; iLine++){
vtkDataSet *aDataSet = myCutLinesPL->GetAppendPolyData()->GetInput(iLine);
aDataSet->Update();
if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLine = "<<iLine<<"; aNbPoints = "<<aNbPoints);
aLineIdCont[iLine] = jLine++;
TXYMap& aXYMap = aXYMapCont[iLine];
- float aPnt[3], aVect[3], aDist;
+ vtkFloatingPointType aPnt[3], aVect[3], aDist;
for(int i = 0; i < aNbPoints; i++){
aDataSet->GetPoint(i,aPnt);
- Sub(aPnt,aBasePnt,aVect);
+ for(int j = 0; j < 3; j++)
+ aVect[i] = aPnt[i] - aBasePnt[i];
+ //VISU::Sub(aPnt,aBasePnt,aVect);
if ( fabs(aBoundPrjLn[2]) < EPS_machine )
aDist = 0.5;
else
TXYMap aNewXYMap;
TXYMap& aXYMap = aXYMapCont[iLine];
TXYMap::const_iterator aXYMapIter = aXYMap.begin();
- std::list<float> XKeys;
+ std::list<vtkFloatingPointType> XKeys;
for (;aXYMapIter != aXYMap.end() ; aXYMapIter++) XKeys.push_back(aXYMapIter->first);
XKeys.sort();
if (XKeys.size() > 1) {
- float a_first_indx = XKeys.front();
- float a_last_indx = XKeys.back();
+ vtkFloatingPointType a_first_indx = XKeys.front();
+ vtkFloatingPointType a_last_indx = XKeys.back();
if (a_first_indx > a_last_indx){
XKeys.reverse();
- float tmp = a_first_indx;
+ vtkFloatingPointType tmp = a_first_indx;
a_first_indx = a_last_indx;
a_last_indx = tmp;
}
- std::list<float>::const_iterator aIter = XKeys.begin();
+ std::list<vtkFloatingPointType>::const_iterator aIter = XKeys.begin();
for (int k=0;k<XKeys.size() && aIter != XKeys.end();k++,aIter++){
// Warning: value '1.0' come from workaround:
// see also aDist = vtkMath::Dot(aVect,aDirLn) / aBoundPrjLn[2];
aNewXYMap[aXYMapIter[0]->first] = aXYMapIter[0]->second;
aXCont.insert(aXYMapIter[0]->first);
for(; aXYMapIter[1] != aXYMap.end(); aXYMapIter[0]++, aXYMapIter[1]++){
- float aY[3] = {aXYMapIter[0]->second, aXYMapIter[1]->second, 0.0};
+ vtkFloatingPointType aY[3] = {aXYMapIter[0]->second, aXYMapIter[1]->second, 0.0};
aY[2] = (aY[0] + aY[1])/2.0;
- float aX[3] = {aXYMapIter[0]->first, aXYMapIter[1]->first, 0.0};
+ vtkFloatingPointType aX[3] = {aXYMapIter[0]->first, aXYMapIter[1]->first, 0.0};
aX[2] = (aX[0] + aX[1])/2.0;
aNewXYMap[aX[2]] = aY[2];
aXCont.insert(aX[2]);
aTableOfReal->SetNbColumns(iEnd);
TXCont::const_iterator aXContIter = aXCont.begin();
for(long i = 0; aXContIter != aXCont.end(); aXContIter++, i++){
- float aDist = *aXContIter;
+ vtkFloatingPointType aDist = *aXContIter;
aTableOfReal->PutValue(aDist,1,i+1);
aString.sprintf("%d",i);
aTableOfReal->SetColumnTitle(i+1,aString.latin1());
TXYMap::const_iterator aXYMapIter = aXYMap.find(aDist);
// Can we find some value that belong to the line and have the same X coordinate?
if(aXYMapIter == aXYMap.end()) continue;
- float aVal = aXYMapIter->second;
+ vtkFloatingPointType aVal = aXYMapIter->second;
aTableOfReal->PutValue(aVal,iLineId+2,i+1);
}
}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.hxx
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.cxx
#include "VISU_CutPlanes_i.hh"
#include "VISU_Actor.h"
+#include "SUIT_ResourceMgr.h"
+
using namespace VISU;
using namespace std;
{
if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
anActor->SetVTKMapping(true);
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aDispMode = aResourceMgr->integerValue("VISU" , "cut_planes_represent", 1);
+ anActor->SetRepresentation(aDispMode);
return anActor;
}
return NULL;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.hxx
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.cxx
#include "VISU_DeformedShapePL.hxx"
#include "VISU_Convertor.hxx"
+#include "SUIT_ResourceMgr.h"
+
#include <vtkDataSetMapper.h>
#include <vtkProperty.h>
::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
VISU_Actor* anActor = VISU::ScalarMap_i::CreateActor(theIO);
- anActor->SetRepresentation(1);
- anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
anActor->SetVTKMapping(false);
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aDispMode = aResourceMgr->integerValue("VISU", "deformed_shape_represent", 1);
+ bool toShrink = aResourceMgr->booleanValue("VISU", "deformed_shape_shrink", false);
+ anActor->SetRepresentation(aDispMode);
+ if (toShrink) anActor->SetShrink();
+ anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
return anActor;
}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.hxx
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_DumpPython.cc
#include "VISU_StreamLines_i.hh"
#include "VISU_Plot3D_i.hh"
#include "VISU_Table_i.hh"
+#include "VISU_GaussPoints_i.hh"
+#include "VISU_ScalarMapOnDeformedShape_i.hh"
#include "utilities.h"
using namespace std;
-namespace VISU{
+namespace VISU
+{
static std::string PREFIX(" ");
typedef std::map<std::string,std::string> TName2EntryMap;
std::string thePrefix);
+ //===========================================================================
+ void
+ Prs3dToPython(VISU::Prs3d_i* theServant,
+ std::ostream& theStr,
+ std::string& theName,
+ std::string thePrefix)
+ {
+ float x, y, z;
+ theServant->GetOffset(x,y,z);
+ theStr<<thePrefix<<theName<<".SetOffset("<<x<<","<<y<<","<<z<<")"<<endl;
+ }
+
//===========================================================================
std::string
- ScalarMapToPython(SALOMEDS::SObject_ptr theSObject,
- VISU::ScalarMap_i* theServant,
- std::ostream& theStr,
- std::string& theName,
- const std::string& theConstructorName,
- const std::string& theArgumentName,
- std::string thePrefix)
+ ColoredPrs3dToPython(SALOMEDS::SObject_ptr theSObject,
+ VISU::ColoredPrs3d_i* theServant,
+ std::ostream& theStr,
+ std::string& theName,
+ const std::string& theConstructorName,
+ const std::string& theArgumentName,
+ std::string thePrefix)
{
std::string aParam;
switch(theServant->GetEntity()){
theStr<<thePrefix<<"if "<<theName<<":"<<endl;
thePrefix += PREFIX;
+ // Add to Name->Object map
theStr<<thePrefix<<"aName2ObjectMap['"<<theName<<"'] = "<<theName<<endl;
+ // Set name (as this object could be renamed by user)
+ CORBA::String_var aNameInStudy = theSObject->GetName();
+ theStr<<thePrefix<<"visu.SetName("<<theName<<",'"<<aNameInStudy.in()<<"')"<<endl;
+
+ // Set parameters common for all Prs3d objects (offset values)
+ Prs3dToPython(theServant,theStr,theName,thePrefix);
+
+ // Set parameters
theStr<<thePrefix<<theName<<".SetScalarMode("<<theServant->GetScalarMode()<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetPosition("<<theServant->GetPosX()<<","<<theServant->GetPosY()<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetSize("<<theServant->GetWidth()<<","<<theServant->GetHeight()<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetNbColors("<<theServant->GetNbColors()<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetLabels("<<theServant->GetLabels()<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetTitle('"<<theServant->GetTitle()<<"')"<<endl;
+
+ return thePrefix;
+ }
+
+
+ std::string
+ ScalarMapToPython(SALOMEDS::SObject_ptr theSObject,
+ VISU::ScalarMap_i* theServant,
+ std::ostream& theStr,
+ std::string& theName,
+ const std::string& theConstructorName,
+ const std::string& theArgumentName,
+ std::string thePrefix)
+ {
+ thePrefix = ColoredPrs3dToPython(theSObject,theServant,theStr,theName,theConstructorName,theArgumentName,thePrefix);
+
+ std::string aParam;
switch(theServant->GetScaling()){
case LINEAR:
aParam = "VISU.LINEAR";
}
theStr<<thePrefix<<theName<<".SetBarOrientation("<<aParam<<")"<<endl;
- theStr<<thePrefix<<theName<<".SetPosition("<<theServant->GetPosX()<<","<<theServant->GetPosY()<<")"<<endl;
- theStr<<thePrefix<<theName<<".SetSize("<<theServant->GetWidth()<<","<<theServant->GetHeight()<<")"<<endl;
- theStr<<thePrefix<<theName<<".SetNbColors("<<theServant->GetNbColors()<<")"<<endl;
- theStr<<thePrefix<<theName<<".SetLabels("<<theServant->GetLabels()<<")"<<endl;
- theStr<<thePrefix<<theName<<".SetTitle('"<<theServant->GetTitle()<<"')"<<endl;
-
return thePrefix;
}
theStr<<thePrefix<<"if "<<aName<<":"<<endl;
std::string aPrefix2 = thePrefix + PREFIX;
+ // Set name (as this object could be renamed by user)
+ CORBA::String_var aNameInStudy = theSObject->GetName();
+ theStr<<aPrefix2<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 1"<<endl;
+
DumpChildrenToPython(theStudy,
theIsPublished,
theIsValidScript,
std::string thePrefix)
{
std::string aName = GetName(theSObject);
- if(aName == "")
+ if (aName == "")
return;
+ CORBA::String_var anID = theSObject->GetID();
+ CORBA::String_var aNameInStudy = theSObject->GetName();
+
CORBA::Object_var anObj = SObjectToObject(theSObject);
- if(!CORBA::is_nil(anObj)){
+ if (!CORBA::is_nil(anObj)) {
VISU::Base_var aBase = VISU::Base::_narrow(anObj);
if(!CORBA::is_nil(aBase)){
std::string aName = GenerateName(theSObject,theName2EntryMap,theEntry2NameMap);
- CORBA::String_var anID = theSObject->GetID();
VISU::VISUType aType = aBase->GetType();
switch(aType){
if(anId == Result_i::eImportFile || anId == Result_i::eCopyAndImportFile){
switch(anId){
case Result_i::eImportFile:
- theStr<<thePrefix<<aName<<" = aVisu.ImportFile('"<<aFileName<<"')"<<endl;
+ //theStr<<thePrefix<<aName<<" = aVisu.ImportFile('"<<aFileName<<"')"<<endl;
+ theStr<<thePrefix<<aName<<" = aVisu.CreateResult('"<<aFileName<<"')"<<endl;
+
+ theStr<<thePrefix<<aName<<".SetBuildGroups("<<
+ aServant->IsGroupsDone()<<")"<<
+ endl;
+
+ theStr<<thePrefix<<aName<<".SetBuildFields("<<
+ aServant->IsFieldsDone()<<","<<
+ aServant->IsMinMaxDone()<<")"<<
+ endl;
+
+ theStr<<thePrefix<<aName<<".Build(0,1)"<<endl;
+
+ theStr<<thePrefix<<"if "<<aName<<".IsDone() :"<<endl;
break;
case Result_i::eCopyAndImportFile:
theStr<<thePrefix<<aName<<" = aVisu.CopyAndImportFile('"<<aFileName<<"')"<<endl;
+ theStr<<thePrefix<<"if "<<aName<<":"<<endl;
break;
}
- theStr<<thePrefix<<"if "<<aName<<":"<<endl;
thePrefix += PREFIX;
theArgumentName = aName;
}
return;
case VISU::TMESH:
- if(Mesh_i* aServant = dynamic_cast<Mesh_i*>(GetServant(anObj).in())){
+ if(Mesh_i* aServant = dynamic_cast<Mesh_i*>(GetServant(anObj).in())){
VISU::Entity anEntity = aServant->GetEntity();
const std::string& aSubMeshName = aServant->GetSubMeshName();
if(anEntity >= 0){
theStr<<thePrefix<<"if "<<aName<<":"<<endl;
thePrefix += PREFIX;
+ // Add to Name->Object map
theStr<<thePrefix<<"aName2ObjectMap['"<<aName<<"'] = "<<aName<<endl;
+ // Set name (as this object could be renamed by user)
+ theStr<<thePrefix<<"visu.SetName("<<aName<<",'"<<aNameInStudy.in()<<"')"<<endl;
+
+ // Set parameters common for all Prs3d objects (offset values)
+ Prs3dToPython(aServant,theStr,aName,thePrefix);
+
+ // Set presentation parameters
SALOMEDS::Color aColor;
aColor = aServant->GetCellColor();
theStr<<thePrefix<<aName<<".SetCellColor(SALOMEDS.Color("<<
theStr<<thePrefix<<"pass"<<endl<<endl;
}
return;
+ case VISU::TSCALARMAPONDEFORMEDSHAPE:
+ if(ScalarMapOnDeformedShape_i* aServant = dynamic_cast<ScalarMapOnDeformedShape_i*>(GetServant(anObj).in())){
+ thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"ScalarMapOnDeformedShapeOnField",theArgumentName,thePrefix);
+
+ theStr<<thePrefix<<aName<<".SetSourceRange("<<aServant->GetSourceRangeMin()<<","<<aServant->GetSourceRangeMax()<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetScale("<<aServant->GetScale()<<")"<<endl;
+
+ std::string aParam;
+ VISU::Entity anEntity = aServant->GetScalarEEntity();
+ switch(anEntity){
+ case NODE:
+ aParam = "VISU.NODE";
+ break;
+ case EDGE:
+ aParam = "VISU.EDGE";
+ break;
+ case FACE:
+ aParam = "VISU.FACE";
+ break;
+ case CELL:
+ aParam = "VISU.CELL";
+ break;
+ }
+
+ theStr<<thePrefix<<aName<<".SetScalarField("<<
+ "'"<<aServant->GetScalarMeshName()<<"',"<<
+ "'"<<aServant->GetScalarFieldName()<<"',"<<
+ aServant->GetScalarIteration()<<","<<
+ aParam<<
+ ")"<<endl;
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
case VISU::TVECTORS:
if(Vectors_i* aServant = dynamic_cast<Vectors_i*>(GetServant(anObj).in())){
thePrefix = DeformedShapeToPython(theSObject,aServant,theStr,aName,"VectorsOnField",theArgumentName,thePrefix);
return;
case VISU::TPLOT3D:
if (Plot3D_i* aServant = dynamic_cast<Plot3D_i*>(GetServant(anObj).in())) {
- thePrefix = ScalarMapToPython(theSObject, aServant, theStr, aName,
- "Plot3DOnField", theArgumentName, thePrefix);
+ thePrefix = ScalarMapToPython(theSObject, aServant, theStr, aName,"Plot3DOnField", theArgumentName, thePrefix);
std::string aParam;
switch(aServant->GetOrientationType()){
theStr<<thePrefix<<"pass"<<endl<<endl;
}
return;
+ case VISU::TGAUSSPOINTS:
+ if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(GetServant(anObj).in())){
+ thePrefix = ColoredPrs3dToPython(theSObject,aServant,theStr,aName,"GaussPointsOnField",theArgumentName,thePrefix);
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
case VISU::TCURVE:
if(Curve_i* aServant = dynamic_cast<Curve_i*>(GetServant(anObj).in()))
{
}
return;
case VISU::TTABLE:
- if(Table_i* aServant = dynamic_cast<Table_i*>(GetServant(anObj).in())){
- SALOMEDS::SObject_var aSObject = aServant->GetSObject();
+ if(dynamic_cast<Table_i*>(GetServant(anObj).in())){
SALOMEDS::GenericAttribute_var anAttr;
if(theSObject->FindAttribute(anAttr,"AttributeComment")){
using namespace SALOMEDS;
theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
+
+ // Set name (as this object could be renamed by user)
+ theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 2"<<endl;
+
theStr<<endl;
theArgumentName = aName;
theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
+
+ // Set name (as this object could be renamed by user)
+ theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 3"<<endl;
+
theStr<<endl;
theArgumentName = aName;
return;
}
}
- }else{
+ } else { /*if(!CORBA::is_nil(anObj))*/
SALOMEDS::GenericAttribute_var anAttr;
- if(theSObject->FindAttribute(anAttr,"AttributeComment")){
+ if (theSObject->FindAttribute(anAttr,"AttributeComment")) {
SALOMEDS::AttributeComment_var aComment =
SALOMEDS::AttributeComment::_narrow(anAttr);
CORBA::String_var aValue = aComment->Value();
Storable::StrToMap(aValue.in(),aMap);
bool anIsExist;
QString aTypeName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist);
- if(anIsExist){
- if(strcmp(aTypeName.latin1(),"ImportTables") == 0){
+ if (anIsExist) {
+ if (strcmp(aTypeName.latin1(),"ImportTables") == 0) {
QString aFileName = VISU::Storable::FindValue(aMap,"myFileName",&anIsExist);
if(anIsExist){
std::string aName = GenerateName(theSObject,theName2EntryMap,theEntry2NameMap);
theStr<<thePrefix<<"pass"<<endl<<endl;
return;
}
- }else if(strcmp(aTypeName.latin1(),"VIEW3D") == 0){
+ } else if (strcmp(aTypeName.latin1(),"VIEW3D") == 0) {
std::string aName = GetName(theSObject);
theStr<<thePrefix<<aName<<" = aBuilder.NewObject(aSComponent)"<<endl;
theStr<<thePrefix<<"pass"<<endl<<endl;
return;
+ } else if (aTypeName == "ENTITY" || aTypeName == "FAMILY" || aTypeName == "GROUP") {
+ // Set name (as this object could be renamed by user)
+ string aMeshName = VISU::Storable::FindValue(aMap,"myMeshName").latin1();
+ string aSubMeshName = VISU::Storable::FindValue(aMap,"myName").latin1();
+ string anEntityTypeKey = "myEntityId";
+ if (aTypeName == "ENTITY") anEntityTypeKey = "myId";
+ int anEntity = VISU::Storable::FindValue(aMap,anEntityTypeKey,"0").toInt();
+ std::string anEntityType;
+ switch ((TEntity)anEntity) {
+ case NODE_ENTITY: anEntityType = "VISU.NODE"; break;
+ case EDGE_ENTITY: anEntityType = "VISU.EDGE"; break;
+ case FACE_ENTITY: anEntityType = "VISU.FACE"; break;
+ case CELL_ENTITY: anEntityType = "VISU.CELL"; break;
+ }
+
+ if (aTypeName == "ENTITY" ) {
+ theStr<<thePrefix<<"aVisu.RenameEntityInStudy("<<theArgumentName<<",'"<<aMeshName
+ <<"',"<<anEntityType<<",'"<<aNameInStudy.in()<<"')"<<endl;
+ }
+ else if (aTypeName == "FAMILY") {
+ if (aSubMeshName != aNameInStudy.in()) {
+ theStr<<thePrefix<<"aVisu.RenameFamilyInStudy("<<theArgumentName<<",'"<<aMeshName
+ <<"',"<<anEntityType<<",'"<<aSubMeshName<<"','"<<aNameInStudy.in()<<"')"<<endl;
+ }
+ }
+ else { // "GROUP"
+ if (aSubMeshName != aNameInStudy.in()) {
+ theStr<<thePrefix<<"aVisu.RenameGroupInStudy("<<theArgumentName<<",'"<<aMeshName
+ <<"','"<<aSubMeshName<<"','"<<aNameInStudy.in()<<"')"<<endl;
+ }
+ }
}
}
- }else{
+ } else {
DumpTableAttrToPython(theStudy,
theIsPublished,
theIsValidScript,
std::string aPrefix = thePrefix + PREFIX;
theArgumentName = aName;
+ // Set name (as this object could be renamed by user)
+ CORBA::String_var aNameInStudy = aSObject->GetName();
+ theStr<<aPrefix<<"visu.SetName("<<aName<<",'"<<aNameInStudy.in()<<"')"<<endl;
+
SALOMEDS::ChildIterator_var aCurveIter = theStudy->NewChildIterator(aSObject);
for(aCurveIter->InitEx(false); aCurveIter->More(); aCurveIter->Next()){
SALOMEDS::SObject_var aRefSObj = aCurveIter->Value();
VISU::DumpChildrenToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aName2EntryMap,aEntry2NameMap,"",aPrefix);
VISU::DumpContainersToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aName2EntryMap,aEntry2NameMap,"",aPrefix);
+ //Output the script that sets up the visul parameters.
+ if(theIsPublished) {
+ char* script = aStudy->GetDefaultScript("Post-Pro", aPrefix.c_str());
+ if(script && strlen(script) > 0) {
+ aStr << script;
+ CORBA::string_free(script);
+ }
+ }
+
aStr<<aPrefix<<"pass"<<endl;
#ifndef COUT
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File :
int aBicolor = aResourceMgr->integerValue( "VISU", "scalar_bar_bicolor", GetBiColor() );
SetBiColor( aBicolor == 0 );
- float aSpacing = aResourceMgr->doubleValue( "VISU", "scalar_bar_spacing", GetSpacing() );
+ vtkFloatingPointType aSpacing = aResourceMgr->doubleValue( "VISU", "scalar_bar_spacing", GetSpacing() );
SetSpacing( aSpacing );
- float aScaleFactor = aResourceMgr->doubleValue( "VISU", "deformed_shape_scale_factor", GetScaleFactor() );
+ vtkFloatingPointType aScaleFactor = aResourceMgr->doubleValue( "VISU", "deformed_shape_scale_factor", GetScaleFactor() );
SetScaleFactor( aScaleFactor );
int aPrimitiveType = aResourceMgr->integerValue( "VISU", "point_sprite_primitive_type", GetPrimitiveType() );
SetPrimitiveType( aPrimitiveType );
- float aClamp = aResourceMgr->doubleValue( "VISU", "point_sprite_clamp", GetClamp() );
+ vtkFloatingPointType aClamp = aResourceMgr->doubleValue( "VISU", "point_sprite_clamp", GetClamp() );
SetClamp( aClamp );
int aMinSize = aResourceMgr->integerValue( "VISU", "point_sprite_min_size", ( int )( GetMinSize() * 100.0 ) );
int aMagnification = aResourceMgr->integerValue( "VISU", "point_sprite_magnification", ( int )( GetMagnification() * 100.0 ) );
SetMagnification( aMagnification / 100.0 );
- float anIncrement = aResourceMgr->doubleValue( "VISU", "point_sprite_increment", GetMagnificationIncrement() );
+ vtkFloatingPointType anIncrement = aResourceMgr->doubleValue( "VISU", "point_sprite_increment", GetMagnificationIncrement() );
SetMagnificationIncrement( anIncrement );
bool isColored = aResourceMgr->booleanValue( "VISU", "point_sprite_results", GetIsColored() );
QColor aColor = aResourceMgr->colorValue( "VISU", "point_sprite_color", GetColor() );
SetColor( aColor );
- float anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "point_sprite_alpha_threshold", GetAlphaThreshold() );
+ vtkFloatingPointType anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "point_sprite_alpha_threshold", GetAlphaThreshold() );
SetAlphaThreshold( anAlphaThreshold );
int aResolution = aResourceMgr->integerValue( "VISU", "geom_sphere_resolution", GetResolution() );
void
VISU::GaussPoints_i
-::SetScaleFactor( float theScaleFactor )
+::SetScaleFactor( vtkFloatingPointType theScaleFactor )
{
myGaussPointsPL->SetScale( theScaleFactor );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetScaleFactor()
{
void
VISU::GaussPoints_i
-::SetAlphaThreshold( float theAlphaThreshold )
+::SetAlphaThreshold( vtkFloatingPointType theAlphaThreshold )
{
myGaussPointsPL->SetAlphaThreshold( theAlphaThreshold );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetAlphaThreshold()
{
return myGaussPointsPL->GetPrimitiveType();
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetMaximumSupportedSize()
{
void
VISU::GaussPoints_i
-::SetClamp(float theClamp)
+::SetClamp(vtkFloatingPointType theClamp)
{
myGaussPointsPL->SetClamp( theClamp );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetClamp()
{
void
VISU::GaussPoints_i
-::SetGeomSize( float theGeomSize )
+::SetGeomSize( vtkFloatingPointType theGeomSize )
{
myGaussPointsPL->SetSize( theGeomSize );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetGeomSize()
{
void
VISU::GaussPoints_i
-::SetMinSize( float theMinSize )
+::SetMinSize( vtkFloatingPointType theMinSize )
{
myGaussPointsPL->SetMinSize( theMinSize );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetMinSize()
{
void
VISU::GaussPoints_i
-::SetMaxSize( float theMaxSize )
+::SetMaxSize( vtkFloatingPointType theMaxSize )
{
myGaussPointsPL->SetMaxSize( theMaxSize );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetMaxSize()
{
void
VISU::GaussPoints_i
-::SetMagnification( float theMagnification )
+::SetMagnification( vtkFloatingPointType theMagnification )
{
myGaussPointsPL->SetMagnification( theMagnification );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetMagnification()
{
void
VISU::GaussPoints_i
-::SetMagnificationIncrement( float theIncrement )
+::SetMagnificationIncrement( vtkFloatingPointType theIncrement )
{
myGaussPointsPL->SetMagnificationIncrement( theIncrement );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetMagnificationIncrement()
{
vtkTextProperty* aTitleProp = theScalarBar->GetTitleTextProperty();
aTitleProp->SetFontFamily(myTitFontType);
- aTitleProp->SetColor(myTitleColor);
+ aTitleProp->SetColor(myTitleColor[0],myTitleColor[1],myTitleColor[2]);
(myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
(myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
(myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
vtkTextProperty* aLabelProp = theScalarBar->GetLabelTextProperty();
aLabelProp->SetFontFamily(myLblFontType);
- aLabelProp->SetColor(myLabelColor);
+ aLabelProp->SetColor(myLabelColor[0],myLabelColor[1],myLabelColor[2]);
(myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
(myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
(myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
anActor->SetBarVisibility(true);
myPipeLine->GetMapper()->SetScalarVisibility(1);
- float aRange[2];
+ vtkFloatingPointType aRange[2];
myScalarMapPL->GetSourceRange(aRange);
aScalarBarCtrl->SetRangeLocal(aRange);
}
if(aScalarBarMode == VISU_ScalarBarCtrl::eGlobal){
- float aRangeGlobal[2];
+ vtkFloatingPointType aRangeGlobal[2];
//
aRangeGlobal[0] = aTMinMax.first;
aRangeGlobal[1] = aTMinMax.second;
void
VISU::GaussPoints_i
-::SetSpacing(const float theSpacing)
+::SetSpacing(const vtkFloatingPointType theSpacing)
{
mySpacing = theSpacing;
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetSpacing() const
{
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.hxx
void
SetIsDeformed( bool theIsDeformed );
- float
+ vtkFloatingPointType
GetScaleFactor();
void
- SetScaleFactor( float theScaleFactor );
+ SetScaleFactor( vtkFloatingPointType theScaleFactor );
//! Get color for Geometry mode of the presentation.
QColor
//! Redirect the request to VISU_GaussPointsPL::SetAlphaThreshold.
void
- SetAlphaThreshold(float theAlphaThreshold);
+ SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold);
//! Redirect the request to VISU_GaussPointsPL::GetAlphaThreshold.
- float
+ vtkFloatingPointType
GetAlphaThreshold();
//! Redirect the request to VISU_GaussPointsPL::SetResolution.
GetPrimitiveType();
//! Redirect the request to VISU_GaussPointsPL::GetMaximumSupportedSize.
- float
+ vtkFloatingPointType
GetMaximumSupportedSize();
//! Redirect the request to VISU_GaussPointsPL::SetClamp.
void
- SetClamp(float theClamp);
+ SetClamp(vtkFloatingPointType theClamp);
//! Redirect the request to VISU_GaussPointsPL::GetClamp.
- float
+ vtkFloatingPointType
GetClamp();
//! Redirect the request to VISU_GaussPointsPL::SetSize.
void
- SetGeomSize(float theGeomSize);
+ SetGeomSize(vtkFloatingPointType theGeomSize);
//! Redirect the request to VISU_GaussPointsPL::GetSize.
- float
+ vtkFloatingPointType
GetGeomSize();
//! Redirect the request to VISU_GaussPointsPL::SetMinSize.
void
- SetMinSize(float theMinSize);
+ SetMinSize(vtkFloatingPointType theMinSize);
//! Redirect the request to VISU_GaussPointsPL::GetMinSize.
- float
+ vtkFloatingPointType
GetMinSize();
//! Redirect the request to VISU_GaussPointsPL::SetMaxSize.
void
- SetMaxSize(float theMaxSize);
+ SetMaxSize(vtkFloatingPointType theMaxSize);
//! Redirect the request to VISU_GaussPointsPL::GetMaxSize.
- float
+ vtkFloatingPointType
GetMaxSize();
//! Redirect the request to VISU_GaussPointsPL::SetMagnification.
void
- SetMagnification(float theMagnification);
+ SetMagnification(vtkFloatingPointType theMagnification);
//! Redirect the request to VISU_GaussPointsPL::GetMagnification.
- float
+ vtkFloatingPointType
GetMagnification();
//! Redirect the request to VISU_GaussPointsPL::SetMagnificationIncrement.
void
- SetMagnificationIncrement(float theIncrement);
+ SetMagnificationIncrement(vtkFloatingPointType theIncrement);
//! Redirect the request to VISU_GaussPointsPL::GetMagnificationIncrement.
- float
+ vtkFloatingPointType
GetMagnificationIncrement();
//! Set flag indicating which scalar bar is active.
//! Set value of the distance between global and local scalar bars.
void
- SetSpacing(const float theSpacing);
+ SetSpacing(const vtkFloatingPointType theSpacing);
//! Get value of the distance between global and local scalar bars.
- float
+ vtkFloatingPointType
GetSpacing() const;
//! Let know is the global range is already calculated
bool myIsDispGlobalScalarBar;
bool myIsActiveLocalScalarBar;
QColor myColor;
- float mySpacing;
+ vtkFloatingPointType mySpacing;
int myFaceLimit;
QString myMainTexture;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_Gen_i.cc
#include <strstream>
#include "Utils_ExceptHandlers.hxx"
+#include "CASCatch.hxx"
using namespace std;
const char* theFieldName,
CORBA::Double theIteration)
{
+ CASCatch_TRY{
#ifndef _DEXCEPT_
- try{
+ try{
#endif
- if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration)))
- return true;
+ if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration)))
+ return true;
#ifndef _DEXCEPT_
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was occured!");
- }
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ }
#endif
+ }CASCatch_CATCH(Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
+ }
return false;
}
//===========================================================================
SALOMEDS::TMPFile* VISU_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
const char* theURL,
- bool isMultiFile)
+ bool theIsMultiFile)
{
Mutex mt(myMutex);
- string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
- TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
+ string aTmpDir = theURL;
if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
- int aCounter = 0;
- TColStd_SequenceOfAsciiString aFileNames;
- SALOMEDS::Study_var aStudy = theComponent->GetStudy();
-
- //CORBA::Boolean anIsValidScript;
- //Engines::TMPFile_var aDump = DumpPython(aStudy,false,anIsValidScript);
+
+ typedef std::vector<std::string> TFileNames;
+ TFileNames aFileNames;
+ TFileNames aFiles;
- SALOMEDS::ChildIterator_var itBig = aStudy->NewChildIterator(theComponent);
- for (; itBig->More(); itBig->Next()) {
- SALOMEDS::SObject_var gotBranch = itBig->Value();
+ SALOMEDS::Study_var aStudy = theComponent->GetStudy();
+ SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent);
+ for (; anIter->More(); anIter->Next()) {
+ SALOMEDS::SObject_var gotBranch = anIter->Value();
CORBA::Object_var anObj = SObjectToObject(gotBranch);
if(CORBA::is_nil(anObj)) continue;
- if(Result_i* pResult = dynamic_cast<Result_i*>(GetServant(anObj).in())){
- switch(pResult->GetCreationId()){
+ if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(anObj).in())){
+ switch(aResult->GetCreationId()){
case Result_i::eImportFile:
case Result_i::eCopyAndImportFile: {
- const QFileInfo& aFileInfo = pResult->GetFileInfo();
- QString aPrefix("");
- if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()).c_str();
- QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str();
- static QString aCommand;
- aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1());
-
- int aRes = system(aCommand);
- if(aRes){
- if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Cann't execute the command :"<<aCommand);
- continue;
- }else
- if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aCommand = "<<aCommand);
-
- TCollection_AsciiString aString(strdup(aFileName.latin1()));
- aFileNames.Append(aString);
+ const QFileInfo& aFileInfo = aResult->GetFileInfo();
+ const std::string& aName = aResult->GetName();
+ std::string aFileName = std::string("_") + aName;
+ std::string aFile = aFileInfo.filePath().latin1();
+ if(theIsMultiFile){
+ aFileName = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()) + aFileName;
+
+ std::ostringstream aStream;
+ aStream<<"cp "<<aFile<<" "<<aTmpDir<<aFileName;
+ std::string aCommand = aStream.str();
+ if(system(aCommand.c_str()) != 0){
+ INFOS("VISU_Gen_i::Save - Cann't execute the command :"<<aCommand);
+ continue;
+ }
+ }
+ aFileNames.push_back(aFileName);
+ aFiles.push_back(aFile);
}}
}
}
- SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0);
- if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aFileNames.Length() - "<<aFileNames.Length());
- if(aFileNames.Length() > 0){
- SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames;
- aSeq->length(aFileNames.Length());
- for(aCounter = aFileNames.Length(); aCounter > 0; aCounter--)
- aSeq[aCounter-1] = CORBA::string_dup(aFileNames.Value(aCounter).ToCString());
- aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.ToCString(), aSeq.in(), isMultiFile);
- if(!isMultiFile)
- SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.ToCString(), aSeq.in(), true);
+
+ if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aFileNames.size() - "<<aFileNames.size());
+
+ SALOMEDS::ListOfFileNames_var aListOfFileNames = new SALOMEDS::ListOfFileNames;
+ if(!aFileNames.empty()){
+ aListOfFileNames->length(aFileNames.size());
+ for(int aCounter = aFileNames.size(); aCounter > 0; aCounter--)
+ aListOfFileNames[aCounter-1] = aFileNames[aCounter-1].c_str();
+ }
+
+ SALOMEDS::ListOfFileNames_var aListOfFiles = new SALOMEDS::ListOfFileNames;
+ aListOfFiles->length(aFiles.size());
+ if(!aFiles.empty()){
+ for(int aCounter = aFileNames.size(); aCounter > 0; aCounter--)
+ aListOfFiles[aCounter-1] = aFiles[aCounter-1].c_str();
}
+
+ SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0);
+ if(theIsMultiFile)
+ aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aListOfFiles.in(), theIsMultiFile);
+ else
+ aStreamFile = SALOMEDS_Tool::PutFilesToStream(aListOfFiles.in(), aListOfFileNames.in());
+
return aStreamFile._retn();
}
}
}
+ void VISU_Gen_i::RenameMeshInStudy(Result_ptr theResult,
+ string theMeshName,
+ int theEntity, // -1 for group indication
+ string theSubMeshName, // Family or Group name
+ string theNewName)
+ {
+ if (myStudyDocument->GetProperties()->IsLocked()) return;
+ Mutex mt(myMutex);
+
+ Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
+ if (!pResult) return;
+
+ QString aComment;
+ VISU::VISUType aType;
+ if (theEntity >= 0)
+ if (theSubMeshName == "")
+ aType = VISU::TENTITY;
+ else
+ aType = VISU::TFAMILY;
+ else
+ aType = VISU::TGROUP;
+
+ switch (aType) {
+ case VISU::TENTITY:
+ aComment.sprintf("myComment=ENTITY;myType=%d;myMeshName=%s;myId=%d",
+ VISU::TENTITY, theMeshName.c_str(), theEntity);
+ break;
+ case VISU::TFAMILY:
+ aComment.sprintf("myComment=FAMILY;myType=%d;myMeshName=%s;myEntityId=%d;myName=%s",
+ VISU::TFAMILY, theMeshName.c_str(), theEntity, theSubMeshName.c_str());
+ break;
+ case VISU::TGROUP:
+ aComment.sprintf("myComment=GROUP;myType=%d;myMeshName=%s;myName=%s",
+ VISU::TGROUP, theMeshName.c_str(), theSubMeshName.c_str());
+ break;
+ }
+
+ string aResultEntry = pResult->GetEntry();
+ string anEntry = pResult->GetEntry(aComment.latin1());
+ if (anEntry == "") return;
+
+ SALOMEDS::SObject_ptr aSObject = myStudyDocument->FindObjectID(anEntry.c_str());
+
+ SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
+ aStudyBuilder->NewCommand(); // There is a transaction
+
+ SALOMEDS::GenericAttribute_var anAttr =
+ aStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeName");
+ SALOMEDS::AttributeName_var aNameAttr = SALOMEDS::AttributeName::_narrow(anAttr);
+ aNameAttr->SetValue(theNewName.c_str());
+
+ aStudyBuilder->CommitCommand();
+ }
+
+ void VISU_Gen_i::RenameEntityInStudy(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theNewName)
+ {
+ RenameMeshInStudy(theResult, theMeshName, (int)theEntity, "", theNewName);
+ }
+
+ void VISU_Gen_i::RenameFamilyInStudy(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFamilyName,
+ const char* theNewName)
+ {
+ RenameMeshInStudy(theResult, theMeshName, (int)theEntity, theFamilyName, theNewName);
+ }
+
+ void VISU_Gen_i::RenameGroupInStudy(Result_ptr theResult,
+ const char* theMeshName,
+ const char* theGroupName,
+ const char* theNewName)
+ {
+ RenameMeshInStudy(theResult, theMeshName, -1, theGroupName, theNewName);
+ }
+
Mesh_ptr VISU_Gen_i::MeshOnEntity(Result_ptr theResult,
const char* theMeshName,
VISU::Entity theEntity)
-// Copyright (C) 2003 CEA/DEN, EDF R&D
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-//
-//
-// File : VISU_GEN_i.h file
+// File : VISU_Gen_i.hh
// Author : Alexey Petrov
// Module : VISU
-// $Header:
#ifndef __VISU_GEN_I_H__
#define __VISU_GEN_I_H__
#include "SALOME_Component_i.hxx"
#include "SALOME_NamingService.hxx"
+#include <string>
+
namespace VISU
{
class Result_i;
ImportMedField(SALOME_MED::FIELD_ptr theField);
+ //Rename Presentation Of Submeshes
+ void
+ RenameMeshInStudy(Result_ptr theResult,
+ std::string theMeshName,
+ int theEntity, // -1 for group indication
+ std::string theSubMeshName, // Family or Group name
+ std::string theNewName);
+ virtual
+ void
+ RenameEntityInStudy(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theNewName);
+ virtual
+ void
+ RenameFamilyInStudy(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFamilyName,
+ const char* theNewName);
+ virtual
+ void
+ RenameGroupInStudy(Result_ptr theResult,
+ const char* theMeshName,
+ const char* theGroupName,
+ const char* theNewName);
+
//Create Presentation Of Submeshes
virtual
Mesh_ptr
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.cxx
#include "VISU_IsoSurfaces_i.hh"
#include "VISU_Actor.h"
+#include "SUIT_ResourceMgr.h"
+
using namespace VISU;
using namespace std;
}
-void VISU::IsoSurfaces_i::SetSubRange(CORBA::Double theMin, CORBA::Double theMax){
- float aRange[2] = {theMin, theMax};
+void VISU::IsoSurfaces_i::SetSubRange(CORBA::Double theMin, CORBA::Double theMax)
+{
+ vtkFloatingPointType aRange[2] = {theMin, theMax};
myIsoSurfacesPL->SetRange(aRange);
}
CORBA::Double VISU::IsoSurfaces_i::GetSubMin(){
{
if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
anActor->SetVTKMapping(true);
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aDispMode = aResourceMgr->integerValue("VISU" , "iso_surfaces_represent", 2);
+ anActor->SetRepresentation(aDispMode);
return anActor;
}
return NULL;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.hxx
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.cxx
#include "SALOME_Event.hxx"
+#include "SUIT_ResourceMgr.h"
+
using namespace VISU;
using namespace std;
if (myResult->GetInput() == NULL)
throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
if (!theRestoring) {
- myPresentType = VISU::SHADED;
+ myPresentType = VISU::PresentationType(VISU::GetResourceMgr()->integerValue("VISU" , "mesh_represent", 2));
+ if(myEntity == VISU::NODE_ENTITY)
+ myPresentType = VISU::POINT;
myName = GenerateName().latin1();
myCellColor.R = 0.0; myCellColor.G = myCellColor.B = 1.0;
myNodeColor.R = myNodeColor.G = 1.0; myNodeColor.B = 1.0;
myMeshPL->Init();
string aResultEntry = myResult->GetEntry();
string anEntry = myResult->GetEntry(aComment.latin1());
- if(anEntry == "") throw std::runtime_error("Mesh_i::Build - anEntry was not found !!!");
+ if(anEntry == "")
+ throw std::runtime_error("Mesh_i::Build - anEntry was not found !!!");
mySObject = myStudy->FindObjectID(anEntry.c_str());
SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(mySObject,"AttributeIOR");
VISU_MeshAct* anActor = VISU_MeshAct::New();
try{
VISU::Prs3d_i::CreateActor(anActor,theIO);
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ bool toShrink = aResourceMgr->booleanValue("VISU", "mesh_shrink", false);
+ if (toShrink) anActor->SetShrink();
UpdateActor(anActor);
}catch (...) {
anActor->Delete();
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.hxx
// 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.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "VISU_Plot3D_i.hh"
#include "VISU_Actor.h"
+#include "SUIT_ResourceMgr.h"
+
using namespace VISU;
using namespace std;
{
if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
anActor->SetVTKMapping(true);
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aDispMode = aResourceMgr->integerValue("VISU", "plot3d_represent", 2);
+ anActor->SetRepresentation(aDispMode);
return anActor;
}
return NULL;
// 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.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef VISU_Plot3D_i_HeaderFile
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_Prs3d_i.cc
theActor->SetPrs3d(this);
theActor->SetShrinkFactor();
- theActor->SetPosition(myOffset);
+ theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
theActor->SetPipeLine(GetPipeLine());
theActor->SetFactory(this);
}catch(std::bad_alloc& ex){
throw std::runtime_error("CreateActor >> No enough memory");
throw ex;
- } catch(std::exception& ex){
- throw ex;
+ } catch(std::exception&){
+ throw;
}catch(...) {
throw std::runtime_error("CreateActor >> unexpected exception was caught!!!");
}
{
if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor - this = "<<this<<"; theActor = "<<theActor);
theActor->ShallowCopyPL(myPipeLine);
- theActor->SetPosition(myOffset);
+ theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
theActor->Modified();
}
void
VISU::Prs3d_i
-::SetPlaneParam (float theDir[3], float theDist, vtkPlane* thePlane)
+::SetPlaneParam (vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theDist,
+ vtkPlane* thePlane)
{
myPipeLine->SetPlaneParam(theDir, theDist, thePlane);
}
//----------------------------------------------------------------------------
void
VISU::Prs3d_i
-::GetBounds(float aBounds[6])
+::GetBounds(vtkFloatingPointType aBounds[6])
{
myPipeLine->GetMapper()->GetBounds(aBounds);
}
void
VISU::Prs3d_i
-::SetOffset(const float* theOffsets)
+::SetOffset(const CORBA::Float* theOffsets)
{
myOffset[0] = theOffsets[0];
myOffset[1] = theOffsets[1];
void
VISU::Prs3d_i
-::SetOffset(float theDx, float theDy, float theDz)
+::SetOffset(CORBA::Float theDx,
+ CORBA::Float theDy,
+ CORBA::Float theDz)
{
myOffset[0] = theDx;
myOffset[1] = theDy;
void
VISU::Prs3d_i
-::GetOffset(float* theOffsets)
+::GetOffset(CORBA::Float* theOffsets)
{
theOffsets[0] = myOffset[0];
theOffsets[1] = myOffset[1];
void
VISU::Prs3d_i
-::GetOffset(float& theDx, float& theDy, float& theDz)
+::GetOffset(CORBA::Float& theDx,
+ CORBA::Float& theDy,
+ CORBA::Float& theDz)
{
theDx = myOffset[0];
theDy = myOffset[1];
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.hxx
#include "SALOME_GenericObj_i.hh"
#include "SALOME_InteractiveObject.hxx"
-#include <boost/signals/signal0.hpp>
+#include "VTKViewer.h"
+
#include <vtkSmartPointer.h>
class VISU_PipeLine;
GetClippingPlane(vtkIdType theID) const;
void
- SetPlaneParam(float theDir[3], float theDist, vtkPlane* thePlane);
+ SetPlaneParam(vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theDist,
+ vtkPlane* thePlane);
//----------------------------------------------------------------------------
void
- GetBounds(float aBounds[6]);
+ GetBounds(vtkFloatingPointType aBounds[6]);
void
- SetOffset(const float* theOffsets);
+ SetOffset(const CORBA::Float* theOffsets);
virtual
void
- SetOffset(float theDx, float theDy, float theDz);
+ SetOffset(CORBA::Float theDx,
+ CORBA::Float theDy,
+ CORBA::Float theDz);
void
- GetOffset(float* theOffsets);
+ GetOffset(CORBA::Float* theOffsets);
virtual
void
- GetOffset(float& theDx, float& theDy, float& theDz);
+ GetOffset(CORBA::Float& theDx,
+ CORBA::Float& theDy,
+ CORBA::Float& theDz);
//----------------------------------------------------------------------------
protected:
CheckDataSet();
bool myAddToStudy;
- float myOffset[3];
+ CORBA::Float myOffset[3];
Result_i *myResult;
VISU_PipeLine *myPipeLine;
SALOMEDS::SObject_var mySObject;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.cxx
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.hxx
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_Result_i.cc
aStudyBuilder->Addreference(aNewObj,aRefSObj);
}
- string
+
+ //---------------------------------------------------------------
+ inline
+ std::string
CreateAttributes(_PTR(Study) theStudyDocument,
const string& theFatherEntry,
const string& theIOR,
const string& theName,
- const string& thePersistentRef,
const string& theComment,
CORBA::Boolean theCreateNew)
{
_PTR(AttributeName) aName (anAttr);
aName->SetValue(theName);
}
- if (thePersistentRef != "") {
- anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributePersistentRef");
- _PTR(AttributePersistentRef) aPRef (anAttr);
- aPRef->SetValue(thePersistentRef);
- }
if (theComment != "") {
anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributeComment");
_PTR(AttributeComment) aCmnt (anAttr);
return aNewObj->GetID();
}
+
+ //---------------------------------------------------------------
+ inline
+ void
+ UpdateAttributes(_PTR(Study) theStudyDocument,
+ const string& theEntry,
+ const string& theIOR,
+ const string& theName,
+ const string& theComment)
+ {
+ TLock aLock(myMutex);
+
+ _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
+ _PTR(SObject) aSObject = theStudyDocument->FindObjectID(theEntry);
+
+ _PTR(GenericAttribute) anAttr;
+ if (theIOR != "") {
+ anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeIOR");
+ _PTR(AttributeIOR) anIOR (anAttr);
+ anIOR->SetValue(theIOR);
+ }
+ if (theName != "") {
+ anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeName");
+ _PTR(AttributeName) aName (anAttr);
+ aName->SetValue(theName);
+ }
+ if (theComment != "") {
+ anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeComment");
+ _PTR(AttributeComment) aCmnt (anAttr);
+ aCmnt->SetValue(theComment);
+ }
+ }
+
+
+ //---------------------------------------------------------------
+ inline
+ void
+ RemoveSObject(_PTR(Study) theStudyDocument,
+ const string& theEntry)
+ {
+ TLock aLock(myMutex);
+
+ _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
+ _PTR(SObject) aSObject = theStudyDocument->FindObjectID(theEntry);
+ aStudyBuilder->RemoveObject(aSObject);
+ }
+
+
//---------------------------------------------------------------
struct TResultManager
{
VISU_Convertor* theInput,
CORBA::Boolean* theIsDone,
std::string theResultEntry,
+ CORBA::Boolean theIsAtOnce,
+ CORBA::Boolean theIsBuildGroups,
+ CORBA::Boolean theIsBuildFields,
_PTR(Study) theStudy)
{
if(*theIsDone)
theResultEntry,
"",
aMeshName,
- "",
aComment.latin1(),
true);
aMesh->myEntry,
"",
"Families",
- "",
aComment.latin1(),
true);
+
+ if(theIsBuildGroups){
+ aMesh->myGroupsEntry =
+ CreateAttributes(theStudy,
+ aMesh->myEntry,
+ "",
+ "",
+ "",
+ true);
+ }
+
+ if(theIsBuildFields){
+ aMesh->myFieldsEntry =
+ CreateAttributes(theStudy,
+ aMesh->myEntry,
+ "",
+ "",
+ "",
+ true);
+ }
+
//Import entities
TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
aSubMeshesEntry,
"",
anEntityName.c_str(),
- "",
aComment.latin1(),
true);
}
VISU_Convertor* theInput,
CORBA::Boolean* theIsDone,
CORBA::Boolean theIsBuild,
+ CORBA::Boolean theIsAtOnce,
_PTR(Study) theStudy)
{
if(!theIsBuild || *theIsDone)
aMeshOnEntity->myEntry,
"",
aFamilyName,
- "",
aComment.latin1(),
true);
}
if(!aGroupMap.empty()){
aComment.sprintf("myComment=GROUPS;myMeshName=%s",
aMeshName.c_str());
- string aGroupsEntry =
- CreateAttributes(theStudy,
- aMesh->myEntry,
- "",
- "Groups",
- "",
- aComment.latin1(),
- true);
+
+ UpdateAttributes(theStudy,
+ aMesh->myGroupsEntry,
+ "",
+ "Groups",
+ aComment.latin1());
+
TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
const string& aGroupName = aGroupMapIter->first;
TGROUP,aMeshName.c_str(),aGroupName.c_str());
aGroup->myEntry =
CreateAttributes(theStudy,
- aGroupsEntry,
+ aMesh->myGroupsEntry,
"",
aGroupName,
- "",
aComment.latin1(),
true);
const TFamilySet& aFamilySet = aGroup->myFamilySet;
aFamily->myEntry);
}
}
- }
+ }else if(!theIsAtOnce)
+ RemoveSObject(theStudy,
+ aMesh->myGroupsEntry);
}
ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
VISU_Convertor* theInput,
CORBA::Boolean* theIsDone,
CORBA::Boolean theIsBuild,
+ CORBA::Boolean theIsAtOnce,
_PTR(Study) theStudy)
{
if(!theIsBuild || *theIsDone)
continue;
//Import fields
- string aFieldsEntry;
- bool anIsFieldsEntryCreated = false;
-
+ bool anIsFieldsEntryUpdated = false;
TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
const TEntity& anEntity = aMeshOnEntityMapIter->first;
const TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
- if(!anIsFieldsEntryCreated){
+ if(!anIsFieldsEntryUpdated){
aComment.sprintf("myComment=FIELDS;myMeshName=%s",
aMeshName.c_str());
- aFieldsEntry =
- CreateAttributes(theStudy,
- aMesh->myEntry,
- "",
- "Fields",
- "",
- aComment.latin1(),
- true);
- anIsFieldsEntryCreated = true;
+
+ UpdateAttributes(theStudy,
+ aMesh->myFieldsEntry,
+ "",
+ "Fields",
+ aComment.latin1());
+
+ anIsFieldsEntryUpdated = true;
}
const string& aFieldName = aFieldMapIter->first;
const PField& aField = aFieldMapIter->second;
aField->myNbComp);
aField->myEntry =
CreateAttributes(theStudy,
- aFieldsEntry,
+ aMesh->myFieldsEntry,
"",
aFieldNameWithUnit.latin1(),
- "",
aComment.latin1(),
true);
CreateReference(theStudy,
aField->myEntry,
"",
aTimeStampId,
- "",
aComment.latin1(),
true);
}
}
}
+
+ if(!anIsFieldsEntryUpdated && !theIsAtOnce)
+ RemoveSObject(theStudy,
+ aMesh->myFieldsEntry);
}
ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
theInput,
theIsFieldsDone,
theIsBuildFields,
+ false,
theStudy);
BuildMinMax(theResult,
theBuildArgs.myInput,
theBuildArgs.myIsEntitiesDone,
theBuildArgs.myResultEntry,
+ false,
+ theBuildArgs.myIsBuildGroups,
+ theBuildArgs.myIsBuildFields,
theBuildArgs.myStudy);
{
boost::thread aThread(boost::bind(&BuildGroups,
theBuildArgs.myInput,
theBuildArgs.myIsGroupsDone,
theBuildArgs.myIsBuildGroups,
+ false,
theBuildArgs.myStudy));
}
{
::Result_i (SALOMEDS::Study_ptr theStudy,
const ESourceId& theSourceId,
const ECreationId& theCreationId,
- CORBA::Boolean theIsBuildImmediately):
+ CORBA::Boolean theIsBuildImmediately,
+ CORBA::Boolean theIsBuildFields,
+ CORBA::Boolean theIsBuildMinMax,
+ CORBA::Boolean theIsBuildGroups):
myStudyDocument(SALOMEDS::Study::_duplicate(theStudy)),
myCreationId(theCreationId),
mySourceId(theSourceId),
myIsBuildImmediately(theIsBuildImmediately),
- myInput(NULL),
+ myIsBuildFields(theIsBuildFields),
+ myIsBuildMinMax(theIsBuildMinMax),
+ myIsBuildGroups(theIsBuildGroups),
myIsEntitiesDone(false),
myIsFieldsDone(false),
myIsGroupsDone(false),
myIsMinMaxDone(false),
- myIsBuildFields(true),
- myIsBuildGroups(true),
- myIsBuildMinMax(true),
- myIsAllDone(false)
+ myIsAllDone(false),
+ myInput(NULL)
{
myStudy = ProcessEvent(new TGetStudy(myStudyDocument->StudyId()));
}
aSComponentEntry.in(),
anIOR.in(),
myName,
- "",
aComment.latin1(),
true);
mySObject = myStudyDocument->FindObjectID(aResultEntry.c_str());
myInput,
&myIsEntitiesDone,
aResultEntry,
+ theIsAtOnce,
+ myIsBuildGroups,
+ myIsBuildFields,
myStudy);
BuildGroups(this,
myInput,
&myIsGroupsDone,
myIsBuildGroups,
+ theIsAtOnce,
myStudy);
BuildFields(this,
myInput,
&myIsFieldsDone,
myIsBuildFields,
+ theIsAtOnce,
myStudy);
BuildMinMax(this,
SALOMEDS::SObject_var aRefSObj, aTargetRefSObj;
if (mySObject->FindSubObject(1, aRefSObj) &&
- aRefSObj->ReferencedObject(aTargetRefSObj)) {
+ aRefSObj->ReferencedObject(aTargetRefSObj))
+ {
if(MYDEBUG) MESSAGE("Result_i::GetInput - There is some reference.");
SALOMEDS::SComponent_var aCompRefSObj = aTargetRefSObj->GetFatherComponent();
CORBA::String_var aDataType = aCompRefSObj->ComponentDataType();
}
if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - mySourceId = " << mySourceId);
myInput = CreateConvertor(myFileInfo.filePath().latin1());
- myInput->Build();
+
+ myInput->BuildEntities();
+ if(myIsBuildFields){
+ myInput->BuildFields();
+ myIsFieldsDone = true;
+ if(myIsBuildMinMax){
+ myInput->BuildMinMax();
+ myIsMinMaxDone = true;
+ }
+ }
+ if(myIsBuildGroups){
+ myInput->BuildGroups();
+ myIsGroupsDone = true;
+ }
+
QString aComment;
aComment.sprintf("myComment=%s;myType=%d;myFileName=%s;myInitFileName=%s",
GetComment(), VISU::TRESULT, myFileInfo.filePath().latin1(),
SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr);
aCmnt->SetValue(aComment.latin1());
}
- bool isBuildAll = VISU::GetResourceMgr()->booleanValue("VISU", "full_med_loading", false);
- if (isBuildAll)
+ bool anIsBuildAll = VISU::GetResourceMgr()->booleanValue("VISU", "full_med_loading", false);
+ if(anIsBuildAll)
BuildAll();
return this;
} catch(std::exception& exc) {
Storable::DataToStream(theStr,"myName",myName.c_str());
Storable::DataToStream(theStr,"myInitFileName",myInitFileName.c_str());
Storable::DataToStream(theStr,"myCreationId",myCreationId);
+ Storable::DataToStream(theStr,"myIsBuildFields",myIsFieldsDone);
+ Storable::DataToStream(theStr,"myIsBuildMinMax",myIsMinMaxDone);
+ Storable::DataToStream(theStr,"myIsBuildGroups",myIsGroupsDone);
}
if(aCreationId == eImportMed || aCreationId == eImportMedField)
aSourceId = eRestoredComponent;
- VISU::Result_i* pResult = new VISU::Result_i(aStudy,aSourceId,aCreationId);
- if (pResult == NULL)
+ CORBA::Boolean anIsBuildFields = Storable::FindValue(theMap,"myIsBuildFields","0").toInt();
+ CORBA::Boolean anIsBuildMinMax = Storable::FindValue(theMap,"myIsBuildMinMax","0").toInt();
+ CORBA::Boolean anIsBuildGroups = Storable::FindValue(theMap,"myIsBuildGroups","0").toInt();
+
+ VISU::Result_i* aResult = new VISU::Result_i(aStudy,
+ aSourceId,
+ aCreationId,
+ anIsBuildFields,
+ anIsBuildMinMax,
+ anIsBuildGroups);
+ if (aResult == NULL)
return NULL;
- return pResult->Restore(theSObject,theMap,thePrefix);
+ return aResult->Restore(theSObject,theMap,thePrefix);
}
//function : GetAxisInfo
//purpose :
//=======================================================================
-const vector< float >* Result_i::GetAxisInfo(const string& theMeshName,
- TAxis theAxis,
- gp_Dir& thePlaneNormal)
+const Result_i::TAxisInfo*
+Result_i
+::GetAxisInfo(const string& theMeshName,
+ TAxis theAxis,
+ gp_Dir& thePlaneNormal)
{
- const vector< float >* components = NULL;
+ const TAxisInfo* components = NULL;
if ( theAxis < AXIS_X || theAxis > AXIS_Z ) {
MESSAGE(" Bad axis index " << theAxis );
if ( nbPnt != 8 )
continue;
vtkPoints * points = cell->GetPoints();
- float* coords[ 4 ];
+ vtkFloatingPointType* coords[ 4 ];
coords[0] = points->GetPoint( 0 );
coords[1] = points->GetPoint( 1 );
coords[2] = points->GetPoint( 3 );
gp_Pnt p0( coords[0][0], coords[0][1], coords[0][2] );
for ( iAx = 0; iAx < nbAxes; ++iAx )
{
- float* coo = coords[ iAx + 1 ];
+ vtkFloatingPointType* coo = coords[ iAx + 1 ];
gp_Pnt p( coo[0], coo[1], coo[2] );
// min size
- float size = p0.SquareDistance( p );
+ vtkFloatingPointType size = p0.SquareDistance( p );
if ( size > FLT_MIN && size < minSize[ iAx ] )
minSize[ iAx ] = size;
// axis direction
// get and sort intermediate component values - projections of nodes
// on axis direction; define bnd box
- set< float > comps[ 3 ];
+ set< vtkFloatingPointType > comps[ 3 ];
Bnd_Box box;
vtkPoints * points = aMesh->GetPoints();
vtkIdType iP, nbP = aMesh->GetNumberOfPoints();
for ( iP = 0; iP < nbP; ++iP )
{
- float* coo = points->GetPoint( iP );
+ vtkFloatingPointType* coo = points->GetPoint( iP );
gp_Pnt p( coo[0], coo[1], coo[2] );
box.Add( p );
for ( iAx = 0; iAx < nbAxes; ++iAx ) {
const gp_Dir& dir = gInfo->myAxis[ iAx ];
- float dot = dir.XYZ() * p.XYZ();
+ vtkFloatingPointType dot = dir.XYZ() * p.XYZ();
comps[ iAx ].insert( dot );
}
}
// find a range of projections of bnd box corners on each axis
- float range[3], firstValue[3];
+ vtkFloatingPointType range[3], firstValue[3];
double x[2],y[2],z[2];
box.Get(x[0],y[0],z[0],x[1],y[1],z[1]);
for ( iAx = 0; iAx < nbAxes; ++iAx ) {
- set< float > bndComps;
+ set< vtkFloatingPointType > bndComps;
const gp_Dir& dir = gInfo->myAxis[ iAx ];
for ( int iX = 0; iX < 2; ++iX ) {
for ( int iY = 0; iY < 2; ++iY ) {
for ( int iZ = 0; iZ < 2; ++iZ ) {
gp_Pnt p( x[ iX ], y[ iY ], z[ iZ ] );
- float dot = dir.XYZ() * p.XYZ();
+ vtkFloatingPointType dot = dir.XYZ() * p.XYZ();
bndComps.insert( dot );
}
}
// compute component values
for ( iAx = 0; iAx < nbAxes; ++iAx )
{
- list< float > values;
+ list< vtkFloatingPointType > values;
int nbVals = 0;
- set< float >& comp = comps[ iAx ];
- set< float >::iterator val = comp.begin();
- float bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ];
- float tol = 0.1 * sqrt( minSize[ iAx ]) / rng;
+ set< vtkFloatingPointType >& comp = comps[ iAx ];
+ set< vtkFloatingPointType >::iterator val = comp.begin();
+ vtkFloatingPointType bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ];
+ vtkFloatingPointType tol = 0.1 * sqrt( minSize[ iAx ]) / rng;
for ( ; val != comp.end(); ++val ) {
- float value = ( *val - first ) / rng;
+ vtkFloatingPointType value = ( *val - first ) / rng;
if ( value > bnd ) {
values.push_back( value );
bnd = value + tol;
}
}
// store values in gInfo
- vector< float >& myComp = gInfo->myComponets[ iAx ];
+ vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ iAx ];
myComp.resize( nbVals );
- list< float >::iterator v = values.begin();
+ list< vtkFloatingPointType >::iterator v = values.begin();
for ( int i = 0; v != values.end(); ++v )
myComp[ i++ ] = *v;
}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_Result_i.hh
#define __VISU_RESULT_I_H__
#include "VISUConfig.hh"
+#include "VISU_BoostSignals.h"
#include "SALOME_GenericObj_i.hh"
-#include <boost/signals/trackable.hpp>
-#include <boost/signals/signal0.hpp>
+#include "VTKViewer.h"
#include <gp_Dir.hxx>
#include <vector>
Result_i(SALOMEDS::Study_ptr theStudy,
const ESourceId& theSourceId,
const ECreationId& theCreationId,
- CORBA::Boolean theIsBuildImmediately = true);
+ CORBA::Boolean theIsBuildImmediately = true,
+ CORBA::Boolean theIsBuildFields = true,
+ CORBA::Boolean theIsBuildMinMax = true,
+ CORBA::Boolean theIsBuildGroups = true);
virtual ~Result_i();
virtual void RemoveFromStudy();
// Info on structured mesh contained in TInput
public:
typedef enum { AXIS_X = 0, AXIS_Y, AXIS_Z } TAxis;
- const std::vector< float >* GetAxisInfo(const std::string& theMeshName,
- TAxis theAxis,
- gp_Dir& thePlaneNormal);
+ typedef std::vector< vtkFloatingPointType > TAxisInfo;
+ const TAxisInfo* GetAxisInfo(const std::string& theMeshName,
+ TAxis theAxis,
+ gp_Dir& thePlaneNormal);
// Return i,j or k values and cutting plane normal for theAxis.
// In the case of any problems, return NULL pointer
private:
struct TGridInfo {
- std::vector< float > myComponets[ 3 ];
- gp_Dir myAxis [ 3 ];
+ TAxisInfo myComponets[ 3 ];
+ gp_Dir myAxis [ 3 ];
};
- map< string, TGridInfo > myMeshName2GridInfoMap;
+ std::map< std::string, TGridInfo > myMeshName2GridInfoMap;
};
Result_var FindResult(SALOMEDS::SObject_ptr theSObject);
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_ScalarMapOnDeformedShape_i.cc
#include "VISU_Convertor.hxx"
#include "VISU_ScalarMapAct.h"
+#include "SUIT_ResourceMgr.h"
+
#include <vtkUnstructuredGrid.h>
#include <vtkProperty.h>
#include <vtkMapper.h>
VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Create(const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, int theIteration)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Create:"<<__LINE__<<endl;
myIsColored = true;
myColor.R = myColor.G = myColor.B = 0.5;
VISU::Storable* aRes = TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Restore(const Storable::TRestoringMap& theMap)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Restore:"<<__LINE__<<endl;
TSuperClass::Restore(theMap);
SetScalarFieldName(VISU::Storable::FindValue(theMap,"myScalarFieldName"));
void VISU::ScalarMapOnDeformedShape_i::ToStream(std::ostringstream& theStr)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::ToStream:"<<__LINE__<<endl;
TSuperClass::ToStream(theStr);
Storable::DataToStream( theStr, "myScalarFieldName", myScalarFieldName.c_str());
VISU::ScalarMapOnDeformedShape_i
::SameAs(const Prs3d_i* theOrigin)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SameAs:"<<__LINE__<<endl;
+ int theScalarIter = this->GetScalarIteration();
+ string theScalarMeshName = this->GetScalarMeshName();
+ string theScalarFieldName = this->GetScalarFieldName();
+ if(MYDEBUG) cout << "SameAs:"<<endl
+ << "\t"<<theScalarIter<<":"<<theScalarMeshName.c_str()<<":"<<theScalarFieldName.c_str()<<endl;
+
TSuperClass::SameAs(theOrigin);
if(const ScalarMapOnDeformedShape_i* aPrs3d = dynamic_cast<const ScalarMapOnDeformedShape_i*>(theOrigin)){
ScalarMapOnDeformedShape_i* anOrigin = const_cast<ScalarMapOnDeformedShape_i*>(aPrs3d);
- // increment the scalar iteration for using in VISU_TimeAnimation class implementation.
this->SetScalarField(anOrigin->GetScalarMeshName().c_str(),
anOrigin->GetScalarFieldName().c_str(),
- anOrigin->GetScalarIteration() + 1,
+ theScalarIter,
anOrigin->GetScalarEntity());
Update();
}
}
void VISU::ScalarMapOnDeformedShape_i::SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange){
- float aRange[2];
- aRange[0] = float(theMinRange);
- aRange[1] = float(theMaxRange);
+ vtkFloatingPointType aRange[2];
+ aRange[0] = vtkFloatingPointType(theMinRange);
+ aRange[1] = vtkFloatingPointType(theMaxRange);
myScalarMapOnDeformedShapePL->SetScalarRange(aRange);
}
CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMin(){
- float aRange[2];
+ vtkFloatingPointType aRange[2];
myScalarMapOnDeformedShapePL->GetSourceRange(aRange);
return aRange[0];
}
CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMax(){
- float aRange[2];
+ vtkFloatingPointType aRange[2];
myScalarMapOnDeformedShapePL->GetSourceRange(aRange);
return aRange[1];
}
void VISU::ScalarMapOnDeformedShape_i::DoHook()
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::DoHook:"<<__LINE__<<endl;
if(!myPipeLine)
myPipeLine = VISU_ScalarMapOnDeformedShapePL::New();
VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::CreateActor:"<<__LINE__<<endl;
VISU_Actor* anActor = TSuperClass::CreateActor(theIO);
- anActor->SetRepresentation(2);
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2);
+ bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_def_shrink", false);
+ anActor->SetRepresentation(aDispMode);
+ if (toShrink) anActor->SetShrink();
anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
anActor->SetVTKMapping(false);
return anActor;
void VISU::ScalarMapOnDeformedShape_i::UpdateActor(VISU_Actor* theActor) {
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::UpdateActor:"<<__LINE__<<endl;
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
if(IsColored()){
anActor->SetBarVisibility(true);
void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
const char* theFieldName,
- const int theIteration,
- const VISU::TEntity theEntity)
+ int theIteration,
+ VISU::TEntity theEntity)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SetScalarField:"<<__LINE__<<endl;
+ if(MYDEBUG) cout << "\ttheFieldName="<<theFieldName<<endl;
+ if(MYDEBUG) cout << "\ttheIteration="<<theIteration<<endl;
+ myScalarField = myResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
+ TVTKOutput* aOut = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)->GetVTKOutput();
if (myScalarMapOnDeformedShapePL){
- myField = myResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
- TVTKOutput* aOut = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,
- theEntity,
- theFieldName,
- theIteration)->GetVTKOutput();
myScalarMapOnDeformedShapePL->SetScalars(aOut);
}
this->SetScalarMeshName(theMeshName);
this->SetScalarEntity(theEntity);
}
+void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
+ const char* theFieldName,
+ CORBA::Long theIteration,
+ VISU::Entity theEntity)
+{
+ this->SetScalarField(theMeshName,theFieldName,(int)theIteration,VISU::TEntity(theEntity));
+}
void VISU::ScalarMapOnDeformedShape_i::SetScalarMeshName(const char* theName){
myScalarMeshName = theName;
void VISU::ScalarMapOnDeformedShape_i::SetScalarIteration(const int theValue){
myScalarIteration = theValue;
}
+
+
int VISU::ScalarMapOnDeformedShape_i::GetScalarIteration(){
return myScalarIteration;
}
void VISU::ScalarMapOnDeformedShape_i::SetScalarEntity(const VISU::TEntity theValue){
myScalarEntity = theValue;
}
+
VISU::TEntity VISU::ScalarMapOnDeformedShape_i::GetScalarEntity(){
return myScalarEntity;
}
+
+void VISU::ScalarMapOnDeformedShape_i::SetScalarEEntity(const VISU::Entity theValue){
+ myScalarEntity = VISU::TEntity(theValue);
+}
+
+VISU::Entity VISU::ScalarMapOnDeformedShape_i::GetScalarEEntity(){
+ return VISU::Entity(myScalarEntity);
+}
+
+const VISU::PField&
+VISU::ScalarMapOnDeformedShape_i
+::GetField() const
+{
+ return myScalarField;
+}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File: VISU_ScalarMapOnDeformedShape_i.hh
void
SameAs(const Prs3d_i* theOrigin);
+ virtual const VISU::PField&
+ GetField() const;
+
VISU_ScalarMapOnDeformedShapePL* GetScalarMapOnDeformedShapePL(){ return myScalarMapOnDeformedShapePL;}
protected:
std::string myScalarFieldName;
VISU::TEntity myScalarEntity;
int myScalarIteration;
+ PField myScalarField;
public:
static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
virtual void SetScalarField(const char* theMeshName,
const char* theFieldName,
- const int theIteration,
- const VISU::TEntity theEntity);
+ int theIteration,
+ VISU::TEntity theEntity);
+
+ virtual void SetScalarField(const char* theMeshName,
+ const char* theFieldName,
+ CORBA::Long theIteration,
+ VISU::Entity theEntity);
virtual void SetScalarFieldName(const char* theName);
virtual std::string GetScalarFieldName();
virtual std::string GetScalarMeshName();
virtual void SetScalarEntity(const VISU::TEntity theValue);
virtual VISU::TEntity GetScalarEntity();
+ virtual void SetScalarEEntity(const VISU::Entity theValue);
+ virtual VISU::Entity GetScalarEEntity();
};
}
#endif
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.cxx
{
if(theMin > theMax)
return;
- float aScalarRange[2] = {theMin, theMax};
+ vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
myScalarMapPL->SetScalarRange(aScalarRange);
myIsFixedRange = true;
}
try{
TSuperClass::CreateActor(anActor,theIO);
anActor->SetBarVisibility(true);
- anActor->SetRepresentation(2);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aDispMode = aResourceMgr->integerValue("VISU", "scalar_map_represent", 2);
+ bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_map_shrink", false);
bool toUseShading = aResourceMgr->booleanValue("VISU", "represent_shading", false);
+ anActor->SetRepresentation(aDispMode);
+ if (toShrink) anActor->SetShrink();
anActor->SetShading(toUseShading);
UpdateActor(anActor);
}catch(...){
vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
aTitleProp->SetFontFamily(myTitFontType);
- aTitleProp->SetColor(myTitleColor);
+ aTitleProp->SetColor(myTitleColor[0],myTitleColor[1],myTitleColor[2]);
(myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
(myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
(myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
aLabelProp->SetFontFamily(myLblFontType);
- aLabelProp->SetColor(myLabelColor);
+ aLabelProp->SetColor(myLabelColor[0],myLabelColor[1],myLabelColor[2]);
(myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
(myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
(myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.hxx
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.cxx
#include "VISU_StreamLinesPL.hxx"
#include "VISU_Convertor.hxx"
+#include "SUIT_ResourceMgr.h"
+
#include <vtkDataSetMapper.h>
#include <vtkAppendFilter.h>
#include <vtkUnstructuredGrid.h>
{
if(VISU_Actor* anActor = VISU::DeformedShape_i::CreateActor(theIO)){
anActor->SetVTKMapping(true);
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aDispMode = aResourceMgr->integerValue("VISU", "stream_lines_represent", 1);
+ anActor->SetRepresentation(aDispMode);
return anActor;
}
return NULL;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.hxx
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_Table_i.cc
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_Table_i.hh
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VISU_TimeAnimation.cxx
// Author : Vitaly SMETANNIKOV
#include "SALOMEDSClient_AttributeComment.hxx"
#include "SALOMEDSClient_AttributeName.hxx"
+#include "CASCatch.hxx"
#include <qpixmap.h>
#include <qimage.h>
#include <qstrlist.h>
+#include <qdir.h>
using namespace std;
if (!CORBA::is_nil(theView3D)) {
VISU::View3D_i* pView = dynamic_cast<VISU::View3D_i*>(GetServant(theView3D).in());
SUIT_ViewWindow* aVW = pView->GetViewWindow();
- myView = VISU::GetViewWindow(aVW);
+ myView = dynamic_cast<SVTK_ViewWindow*>(aVW);
connect( myView, SIGNAL( destroyed() ), this, SLOT( onViewDeleted() ) );
}
- myMaxVal = 0;
- myMinVal = 0;
+ myTimeMinVal = 0;
+ myTimeMaxVal = 0;
myTimeMin = 0;
myTimeMax = 0;
myLastError = "";
myCycling = false;
myAnimEntry = "";
+
+ myDumpPath = "";
+ myAVIMaker = "jpeg2yuv";
}
for (int i = 0; i < getNbFields(); i++) {
clearData(myFieldsLst[i]);
}
+
+ /* Terminates the execution of the thread.
+ * The thread may or may not be terminated immediately,
+ * depending on the operating system's scheduling policies.
+ *
+ * Use QThread::wait() after terminate() for synchronous termination.
+ *
+ * When the thread is terminated, all threads waiting for the the thread to finish will be woken up.
+ *
+ * Warning: This function is dangerous, and its use is discouraged.
+ * The thread can be terminated at any point in its code path.
+ * Threads can be terminated while modifying data.
+ * There is no chance for the thread to cleanup after itself,
+ * unlock any held mutexes, etc. In short, use this function only if absolutely necessary.
+ */
+ myDumpPath = "";
+ QThread::wait(100);
+ QThread::terminate();
+ QThread::wait(400);
}
FieldData& theData,
VISU::Result_i* theResult,
bool theIsRangeDefined,
- CORBA::Double& theMinVal,
- CORBA::Double& theMaxVal,
CORBA::Double theTimeMin,
CORBA::Double theTimeMax)
{
- theMinVal = VTK_LARGE_FLOAT;
- theMaxVal = -VTK_LARGE_FLOAT;
+ double aMin = VTK_LARGE_FLOAT, aMax = -VTK_LARGE_FLOAT;
_PTR(ChildIterator) anIter = theStudy->NewChildIterator(theData.myField);
anIter->Next(); // First is reference on support
QString aFieldName = VISU::Storable::FindValue(aTimeMap,"myFieldName");
int aTimeStampId = VISU::Storable::FindValue(aTimeMap,"myTimeStampId").toInt();
+ bool anIsCreated = false;
TPrs3d* aPresent = new TPrs3d(theResult, false);
- aPresent->Create(aMeshName.latin1(), anEntity,
- aFieldName.latin1(), aTimeStampId);
- theData.myPrs[aFrameId++] = aPresent;
-
- theMinVal = std::min(aPresent->GetMin(),theMinVal);
- theMaxVal = std::max(aPresent->GetMax(),theMaxVal);
+ CASCatch_TRY{
+ try{
+ if(aPresent->Create(aMeshName.latin1(),anEntity,aFieldName.latin1(),aTimeStampId)){
+ anIsCreated = true;
+ theData.myPrs[aFrameId++] = aPresent;
+ aMin = std::min(aPresent->GetMin(), aMin);
+ aMax = std::max(aPresent->GetMax(), aMax);
+ }
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ }
+ }CASCatch_CATCH(Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
+ }
+ if(!anIsCreated)
+ aPresent->_remove_ref();
}
theData.myNbFrames = aFrameId;
if( aRangeType != 1 ){
for(long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++) {
if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(theData.myPrs[aFrameId])){
- aPrs->SetRange(theMinVal, theMaxVal);
+ aPrs->SetRange(aMin, aMax);
aPrs->SetOffset(theData.myOffset);
}
}
if (theData.myPrsType == VISU::TISOSURFACE)
for (long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++)
if (VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(theData.myPrs[aFrameId]))
- aPrs->SetSubRange(theMinVal, theMaxVal);
+ aPrs->SetSubRange(aMin, aMax);
}
}
}
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TISOSURFACE: // Iso Surfaces
GeneratePresentations<IsoSurfaces_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TCUTPLANES: // Cut Planes
GeneratePresentations<CutPlanes_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TCUTLINES: // Cut Lines
GeneratePresentations<CutLines_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TPLOT3D: // Plot3d
GeneratePresentations<Plot3D_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TDEFORMEDSHAPE: // Deformed Shape
GeneratePresentations<DeformedShape_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TVECTORS: // Vectors
GeneratePresentations<Vectors_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TSTREAMLINES: // Stream Lines
GeneratePresentations<StreamLines_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TGAUSSPOINTS: // Gauss Points
GeneratePresentations<GaussPoints_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TSCALARMAPONDEFORMEDSHAPE: // Scalar map on deformed shape
GeneratePresentations<ScalarMapOnDeformedShape_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
default:
MESSAGE("Not implemented for this presentation type: " << aData.myPrsType);
double aOneVal = 1;
if (myFieldsLst[0].myNbFrames > 2)
aOneVal = myFieldsLst[0].myTiming[1] - myFieldsLst[0].myTiming[0];
+ myFileIndex = 0;
+ int aNbFiles = 0;
+ QValueList<int> anIndexList;
+
qApp->lock();
while (myIsActive) {
emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
+ if(!(myFieldsLst[0].myField))
+ break;
for (int i = 0; i < getNbFields(); i++) {
FieldData& aData = myFieldsLst[i];
if (myFrame > 0) {
}
}
int delay = (int)(1000. * k / mySpeed);
+ isDumping = !myDumpPath.isEmpty();
if (delay < 1 && isDumping) {
// We must unlock mutex for some time before grabbing to allow view updating
delay = 1;
if (isDumping) {
// We must unlock mutex for some time before grabbing to allow view updating
qApp->unlock();
- msleep(100);
+ msleep(delay);
qApp->lock();
+ if(!(myFieldsLst[0].myField)) // break, if field was deleted.
+ break;
+ if (myDumpFormat.compare("AVI") != 0) {
+ QString aFile(myDumpPath);
+ QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
+ int aPos = -1;
+ while ((aPos = aName.find(".")) > -1 )
+ aName.replace(aPos, 1, "_");
+ aFile += aName;
+ aFile += ".";
+ aFile += myDumpFormat.lower();
+ myView->dumpViewToFormat(aFile,myDumpFormat);
+ } else {
+ QFileInfo aFileInfo(myDumpPath);
+ QString aDirPath = aFileInfo.dirPath(true);
+ QString aBaseName = aFileInfo.fileName();
+
+ switch (myFrame) {
+ case 0:
+ break;
+ case 1:
+ myFileIndex += 5;
+ break;
+ default:
+ if (myProportional) {
+ double p = (myFieldsLst[0].myTiming[myFrame] -
+ myFieldsLst[0].myTiming[myFrame-1]) / aOneVal;
+ myFileIndex += (long) (5*p);
+ } else {
+ myFileIndex += 5;
+ }
+ }
- QPixmap px = QPixmap::grabWindow(myView->winId());
- QString aFile(myDumpPath);
- QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
- int aPos = -1;
- while ((aPos = aName.find(".")) > -1 )
- aName.replace(aPos, 1, "_");
- aFile += aName;
- aFile += ".";
- aFile += myDumpFormat.lower();
- px.save(aFile, myDumpFormat);
+ QString aFile = aDirPath + QDir::separator() + aBaseName;
+ aFile += "_";
+ aFile += QString("%1").arg(myFileIndex).rightJustify(8, '0');
+ aFile += ".jpeg";
+
+ /* check image size is divisable 16
+ myView->dumpViewToFormat(aFile,"JPEG");
+ */
+ SUIT_ViewWindow* aView = myView;
+ QImage img = aView->dumpView();
+ if (!img.isNull()) {
+ int width = img.width(); width = (width/16)*16;
+ int height = img.height(); height = (height/16)*16;
+ QImage copy = img.copy(0, 0, width, height);
+ if (copy.save(aFile, "JPEG")) {
+ anIndexList.append(myFileIndex);
+ aNbFiles++;
+ }
+ }
+ }
}
if (!myIsActive) break;
myFrame = 0;
}
}
+
+ // make AVI file if need
+ if (isDumping && myDumpFormat.compare("AVI") == 0) {
+ double aFPS = 17.3 * mySpeed;
+
+ QFileInfo aFileInfo(myDumpPath);
+ QString aDirPath = aFileInfo.dirPath(true);
+ QString aBaseName = aFileInfo.fileName();
+
+ // add missing files
+ if (anIndexList.count() > 1) {
+ QString aFFile = aDirPath + QDir::separator() + aBaseName;
+ aFFile += QString("_%1.jpeg");
+ int aStartIndex = anIndexList[0], anEndIndex;
+ for (int i = 1; i < anIndexList.count(); i++) {
+ anEndIndex = anIndexList[i];
+ QString aCurFile = aFFile.arg(QString::number(aStartIndex).rightJustify(8, '0'));
+ QStringList aCommands;
+ for (int j = aStartIndex+1; j < anEndIndex; j++) {
+ QString aFile = aFFile.arg(QString::number(j).rightJustify(8, '0'));
+ aCommands.append(QString("ln -s %1 %2").arg(aCurFile).arg(aFile));
+ }
+ system(aCommands.join(" ; \\\n").latin1());
+ aStartIndex = anEndIndex;
+ }
+ }
+
+ // make AVI file
+ QString aPattern = aDirPath + QDir::separator() + aBaseName;
+ aPattern += "_\%08d.jpeg";
+
+ QString aCmd = myAVIMaker;
+ aCmd += " -I p";
+ aCmd += " -v 0";
+ aCmd += QString(" -f %1").arg(aFPS);
+ // aCmd += QString(" -n %1").arg(aNbFiles);
+ aCmd += QString(" -n %1").arg(myFileIndex+1);
+ aCmd += QString(" -j %1").arg(aPattern);
+ aCmd += " | yuv2lav";
+ aCmd += QString(" -o %1").arg(myDumpPath);
+ system(aCmd.latin1());
+
+ // remove temporary jpeg files
+ aCmd = "( ";
+ aCmd += QString("cd %1").arg(aDirPath);
+ aCmd += "; ls";
+ aCmd += QString(" | egrep '%1_[0-9]*.jpeg'").arg(aBaseName);
+ aCmd += " | xargs rm";
+ aCmd += " )";
+ system(aCmd.latin1());
+ }
+
emit stopped();
qApp->unlock();
QThread::exit();
{
myDumpFormat = theFormat;
QStrList aDumpFormats = QImageIO::outputFormats();
- if (myDumpFormat.isEmpty() || aDumpFormats.find(theFormat) < 0) {
+ if (myDumpFormat.isEmpty() ||
+ (aDumpFormats.find(theFormat) < 0 && myDumpFormat.compare("AVI") != 0)) {
if (aDumpFormats.find("JPEG"))
myDumpFormat = "JPEG";
else
return myDumpFormat.latin1();
}
+//------------------------------------------------------------------------
+bool VISU_TimeAnimation::checkAVIMaker() const
+{
+ QStrList aDumpFormats = QImageIO::outputFormats();
+ if (aDumpFormats.find("JPEG") < 0) return false;
+
+ QString aCmd("which ");
+ aCmd += myAVIMaker;
+ aCmd += " >& /dev/null";
+ int iErr = system(aCmd.latin1());
+ return (iErr == 0);
+}
+
//************************************************************************
int VISU_TimeAnimation::myNBAnimations = 0;
QString VISU_TimeAnimation::GenerateName()
std::string aSComponentEntry = aSComponent->GetID();
QString aComment;
- aComment.sprintf("myComment=ANIMATION;myType=%d;myMinVal=%g;myMaxVal=%g",
- VISU::TANIMATION,myMinVal,myMaxVal);
+ aComment.sprintf("myComment=ANIMATION;myType=%d;myTimeMinVal=%g;myTimeMaxVal=%g",
+ VISU::TANIMATION,myTimeMinVal,myTimeMaxVal);
string anEntry = VISU::CreateAttributes(myStudy,aSComponentEntry.c_str(),"","",
GenerateName(),"",aComment,true);
std::string aSComponentEntry = aSComponent->GetID();
QString aComment;
- aComment.sprintf("myComment=ANIMATION;myType=%d;myMinVal=%g;myMaxVal=%g",
- VISU::TANIMATION,myMinVal,myMaxVal);
+ aComment.sprintf("myComment=ANIMATION;myType=%d;myTimeMinVal=%g;myTimeMaxVal=%g",
+ VISU::TANIMATION,myTimeMinVal,myTimeMaxVal);
_PTR(GenericAttribute) anAttr;
anAttr = aStudyBuilder->FindOrCreateAttribute(aAnimSObject, "AttributeComment");
VISU::Storable::StrToMap(strIn,aMap);
bool isExist;
- myMinVal = VISU::Storable::FindValue(aMap,"myMinVal",&isExist).toDouble();
- myMaxVal = VISU::Storable::FindValue(aMap,"myMaxVal",&isExist).toDouble();
+ myTimeMinVal = VISU::Storable::FindValue(aMap,"myTimeMinVal",&isExist).toDouble();
+ myTimeMaxVal = VISU::Storable::FindValue(aMap,"myTimeMaxVal",&isExist).toDouble();
_PTR(ChildIterator) anIter = myStudy->NewChildIterator(aAnimSObject);
for (anIter->Init(); anIter->More(); anIter->Next()) {
aData.myPrs[0]->GetOffset(aData.myOffset);
for (int i = 1; i < aData.myNbFrames; i++) {
//jfa 03.08.2005:aData.myPrs[i]->SameAs(aData.myPrs[0]);
- //enk 06.02.2006:aData.myPrs[i]->SameAsParams(aData.myPrs[0]);//jfa 03.08.2005
- aData.myPrs[i]->SameAsParams(aData.myPrs[i-1]);//enk 06.02.2006: initializing from previous presentation
+ aData.myPrs[i]->SameAsParams(aData.myPrs[0]);//jfa 03.08.2005
}
}
string aStr = aAnimSObject->GetID();
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VISU_TimeAnimation.h
// Author : Vitaly SMETANNIKOV
class SVTK_ViewWindow;
class VISU_Actor;
-namespace VISU{
+namespace VISU
+{
class Result_i;
class ColoredPrs3d_i;
}
std::vector<VISU::ColoredPrs3d_i*> myPrs; // Presentations
std::vector<VISU_Actor*> myActors; // Actors
std::vector<double> myTiming; // time values
- float myOffset[3];
+ CORBA::Float myOffset[3];
};
SVTK_ViewWindow* getViewer() { return myView; }
void clearView();
void clearData(FieldData& theData);
+ void clearFieldData() { myFieldsLst.clear();};
void stopAnimation();
void startAnimation();
CORBA::Boolean isProportional() { return myProportional; }
void setAnimationRange(CORBA::Double theMin, CORBA::Double theMax)
- { myMaxVal = theMax; myMinVal = theMin; }
+ { myTimeMinVal = theMin; myTimeMaxVal = theMax; }
- CORBA::Double getMinRange() { return myMinVal; }
- CORBA::Double getMaxRange() { return myMaxVal; }
- CORBA::Boolean isRangeDefined() { return !((myMaxVal==0) && (myMinVal == myMaxVal)); }
+ CORBA::Double getMinRange() { return myTimeMinVal; }
+ CORBA::Double getMaxRange() { return myTimeMaxVal; }
+ CORBA::Boolean isRangeDefined() { return !((myTimeMaxVal == 0) && (myTimeMinVal == myTimeMaxVal)); }
void dumpTo(const char* thePath) { myDumpPath = thePath; }
std::string setDumpFormat(const char* theFormat);
+ bool checkAVIMaker() const;
QString getLastErrorMsg() { return myLastError; }
private slots:
void onViewDeleted();
-
+
private:
QString myLastError;
bool myCycling;
_PTR(Study) myStudy;
- double myMaxVal, myMinVal;
- double myTimeMin, myTimeMax;
+ double myTimeMinVal, myTimeMaxVal; //!< Range of time stams, set by user
+ double myTimeMin , myTimeMax ; //!< Range of time stams, available for animation
QString myDumpPath;
QString myDumpFormat;
+ QString myAVIMaker;
+ long myFileIndex;
SVTK_ViewWindow* myView;
QString myAnimEntry;
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_Vectors_i.cc
#include "VISU_VectorsPL.hxx"
#include "VISU_Convertor.hxx"
+#include "SUIT_ResourceMgr.h"
+
#include <vtkProperty.h>
using namespace VISU;
anActor->SetBarVisibility(true);
anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
anActor->GetProperty()->SetLineWidth(GetLineWidth());
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aDispMode = aResourceMgr->integerValue("VISU", "vectors_represent", 1);
+ anActor->SetRepresentation(aDispMode);
UpdateActor(anActor);
}catch(...){
anActor->Delete();
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_PrsObject_i.hxx
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_ViewManager_i.cc
//===========================================================================
// VISU namespace functions
//===========================================================================
- SVTK_ViewWindow* GetViewWindow (SUIT_ViewWindow* theStudyFrame)
+ vtkRenderer* GetRenderer (SUIT_ViewWindow* theViewWindow)
{
- return dynamic_cast<SVTK_ViewWindow*>(theStudyFrame);
- }
-
- vtkRenderer* GetRenderer (SUIT_ViewWindow* theStudyFrame)
- {
- return GetViewWindow(theStudyFrame)->getRenderer();
+ if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(theViewWindow))
+ return vw->getRenderer();
+ return NULL;
}
- vtkCamera* GetCamera (SUIT_ViewWindow* theStudyFrame)
+ vtkCamera* GetCamera (SUIT_ViewWindow* theViewWindow)
{
- return GetRenderer(theStudyFrame)->GetActiveCamera();
+ return GetRenderer(theViewWindow)->GetActiveCamera();
}
void RepaintView (SUIT_ViewWindow* theViewWindow)
{
- SVTK_ViewWindow* vf = GetViewWindow(theViewWindow);
- vf->getRenderer()->ResetCameraClippingRange();
- vf->getRenderWindow()->Render();
+ if (SVTK_ViewWindow* vf = dynamic_cast<SVTK_ViewWindow*>(theViewWindow)) {
+ vf->getRenderer()->ResetCameraClippingRange();
+ vf->getRenderWindow()->Render();
+ }
}
- VISU_Actor* UpdateViewer (SUIT_ViewWindow* theStudyFrame, int theDisplaing, Prs3d_i* thePrs)
+ VISU_Actor* UpdateViewer (SUIT_ViewWindow* theViewWindow, int theDisplaing, Prs3d_i* thePrs)
{
- SVTK_ViewWindow* vf = GetViewWindow(theStudyFrame);
+ SVTK_ViewWindow* vf = dynamic_cast<SVTK_ViewWindow*>(theViewWindow);
if (!vf) return NULL;
if(MYDEBUG) MESSAGE("UpdateViewer - theDisplaing = "<<theDisplaing<<"; thePrs = "<<thePrs);
vtkRenderer *aRen = vf->getRenderer();
}
}
if (aResActor) {
- RepaintView(theStudyFrame);
+ RepaintView(theViewWindow);
return aResActor;
}
if(thePrs != NULL && theDisplaing < eErase){
return NULL;
}
}
- RepaintView(theStudyFrame);
+ RepaintView(theViewWindow);
return anVISUActor;
}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_ViewManager_i.hh
SalomeApp_Application *myApplication;
};
- SVTK_ViewWindow* GetViewWindow (SUIT_ViewWindow* theStudyFrame);
- vtkRenderer* GetRenderer (SUIT_ViewWindow* theStudyFrame);
- vtkCamera* GetCamera (SUIT_ViewWindow* theStudyFrame);
+ vtkRenderer* GetRenderer (SUIT_ViewWindow* theViewWindow);
+ vtkCamera* GetCamera (SUIT_ViewWindow* theViewWindow);
- void RepaintView (SUIT_ViewWindow* theStudyFrame);
+ void RepaintView (SUIT_ViewWindow* theViewWindow);
enum Displaing {eDisplayAll, eDisplay, eDisplayOnly, eErase, eEraseAll};
- VISU_Actor* UpdateViewer (SUIT_ViewWindow* theStudyFrame, int theDisplaing, Prs3d_i* thePrs = NULL);
+ VISU_Actor* UpdateViewer (SUIT_ViewWindow* theViewWindow, int theDisplaing, Prs3d_i* thePrs = NULL);
void UpdatePlot2d (Plot2d_ViewFrame *theView, int theDisplaying, Curve_i* theCurve);
VISU_I_EXPORT VISU_Actor* GetActor (VISU::Prs3d_i* thePrs, SVTK_ViewWindow* theViewWindow);
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_View_i.cc
#include "VISU_Gen_i.hh"
#include "VISU_Prs3d_i.hh"
#include "VISU_Table_i.hh"
+#include "VISU_ScalarMap_i.hh"
#include "VISU_ViewManager_i.hh"
#include "VisuGUI_TableDlg.h"
#include "VISU_Actor.h"
+#include "VISU_ScalarMapAct.h"
#include "SALOME_Event.hxx"
}else{
if(SUIT_ViewManager* aViewManager = myApplication->activeViewManager()){
if(SUIT_ViewWindow* aView = aViewManager->getActiveView()){
- if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aView)){
+ if(dynamic_cast<SVTK_ViewWindow*>(aView)){
myView3D->myViewManager = aViewManager;
myResult = aViewManager->getActiveView();
}
{}
virtual void Execute()
{
- SVTK_ViewWindow* vf = VISU::GetViewWindow(myVW);
+ SVTK_ViewWindow* vf = dynamic_cast<SVTK_ViewWindow*>(myVW);
vtkRenderer* Renderer = vf->getRenderer();
vtkActorCollection* theActors = Renderer->GetActors();
theActors->InitTraversal();
{
Storable::DataToStream(theStr,"myType",VISU::TVIEW3D);
- float backint[3];
+ vtkFloatingPointType backint[3];
GetRenderer(theViewWindow)->GetBackground(backint);
Storable::DataToStream(theStr,"myColor.R",backint[0]);
Storable::DataToStream(theStr,"myColor.G",backint[1]);
Storable::DataToStream(theStr,"myParallelScale",GetParallelScale(theViewWindow));
double aScaleFactor[3];
- VISU::GetViewWindow(theViewWindow)->GetScale(aScaleFactor);
+ (dynamic_cast<SVTK_ViewWindow*>(theViewWindow))->GetScale(aScaleFactor);
Storable::DataToStream(theStr,"myScaleFactor[0]",aScaleFactor[0]);
Storable::DataToStream(theStr,"myScaleFactor[1]",aScaleFactor[1]);
Storable::DataToStream(theStr,"myScaleFactor[2]",aScaleFactor[2]);
aColor[1] = int(255.0*theColor.G);
aColor[2] = int(255.0*theColor.B);
QColor aNewColor (aColor[0],aColor[1],aColor[2]);
- VISU::GetViewWindow(theViewWindow)->setBackgroundColor(aNewColor);
+ (dynamic_cast<SVTK_ViewWindow*>(theViewWindow))->setBackgroundColor(aNewColor);
}
SALOMEDS::Color View3D_i::GetBackground (SUIT_ViewWindow* theViewWindow)
{
SALOMEDS::Color aColor;
- float backint[3];
+ vtkFloatingPointType backint[3];
GetRenderer(theViewWindow)->GetBackground(backint);
aColor.R = backint[0]; aColor.G = backint[1]; aColor.B = backint[2];
return aColor;
SUIT_ViewWindow* aVW = GetViewWindow();
if (aVW) {
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW), &SVTK_ViewWindow::onFitAll));
+ (dynamic_cast<SVTK_ViewWindow*>(aVW), &SVTK_ViewWindow::onFitAll));
Update();
}
}
switch (theType) {
case VISU::View3D::FRONT :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW), &SVTK_ViewWindow::onFrontView));
+ (dynamic_cast<SVTK_ViewWindow*>(aVW), &SVTK_ViewWindow::onFrontView));
break;
case VISU::View3D::BACK :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW), &SVTK_ViewWindow::onBackView));
+ (dynamic_cast<SVTK_ViewWindow*>(aVW), &SVTK_ViewWindow::onBackView));
break;
case VISU::View3D::LEFT :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onLeftView));
+ (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onLeftView));
break;
case VISU::View3D::RIGHT :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onRightView));
+ (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onRightView));
break;
case VISU::View3D::TOP :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onTopView));
+ (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onTopView));
break;
case VISU::View3D::BOTTOM :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onBottomView));
+ (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onBottomView));
break;
}
Update();
void View3D_i::ScaleView (SUIT_ViewWindow* theViewWindow,
VISU::View3D::Axis theAxis, CORBA::Double theParam)
{
- SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(theViewWindow);
+ SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(theViewWindow);
double aScaleFactor[3];
aViewWindow->GetScale(aScaleFactor);
aScaleFactor[theAxis] = theParam;
void SetScaleView (SUIT_ViewWindow* theViewWindow, const CORBA::Double theScale[3])
{
double aScale[3] = {theScale[0], theScale[1], theScale[2]};
- VISU::GetViewWindow(theViewWindow)->SetScale(aScale);
+ (dynamic_cast<SVTK_ViewWindow*>(theViewWindow))->SetScale(aScale);
}
void View3D_i::ScaleView(VISU::View3D::Axis theAxis, CORBA::Double theParam)
SUIT_ViewWindow* aVW = GetViewWindow();
if (aVW) {
double aScale[3];
- VISU::GetViewWindow(aVW)->GetScale(aScale);
+ (dynamic_cast<SVTK_ViewWindow*>(aVW))->GetScale(aScale);
aScale[theAxis] = theParam;
ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,aVW,aScale));
}
ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,aVW,aScale));
}
}
+
+ //================================================
+ // Certain presentation view parameters management
+ //================================================
+ class TPrsManageEvent: public SALOME_Event
+ {
+ protected:
+ View3D_i* myView3D;
+ ScalarMap_ptr myPrs;
+ string myError;
+
+ TPrsManageEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
+ myView3D(theView3D),
+ myPrs(ScalarMap::_duplicate(thePrs)),
+ myError("Unknown error occured")
+ {}
+ VISU_Actor* GetMyActor()
+ {
+ SUIT_ViewWindow* aVW = myView3D->GetViewWindow();
+ SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aVW);
+ if (!aVW) {
+ myError = "Corrupted view window";
+ } else {
+ ScalarMap_i* aPrs = dynamic_cast<ScalarMap_i*>(VISU::GetServant(myPrs).in());
+ if (!aPrs) {
+ myError = "Corrupted presentation";
+ } else {
+ VISU_Actor* anActor = VISU::GetActor(aPrs, vw);
+ if (!anActor) {
+ myError = "No actor found. Display the presentation at first.";
+ } else {
+ myError = "";
+ return anActor;
+ }
+ }
+ }
+ return NULL;
+ }
+ };
+
+ // Get
+ class TGetPrsTypeEvent: public TPrsManageEvent {
+ public:
+ typedef VISU::PresentationType TResult;
+ TResult myResult;
+ TGetPrsTypeEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
+ TPrsManageEvent(theView3D, thePrs), myResult(VISU::SHRINK) {}
+ virtual void Execute() {
+ if (VISU_Actor* anActor = GetMyActor())
+ myResult = (VISU::PresentationType)anActor->GetRepresentation();
+ }
+ };
+
+ class TGetShrinkedEvent: public TPrsManageEvent {
+ public:
+ typedef bool TResult;
+ TResult myResult;
+ TGetShrinkedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
+ TPrsManageEvent(theView3D, thePrs), myResult(false) {}
+ virtual void Execute() {
+ if (VISU_Actor* anActor = GetMyActor()) {
+ if (anActor->IsShrunkable())
+ myResult = anActor->IsShrunk();
+ else
+ myResult = false;
+ }
+ }
+ };
+
+ class TGetShadedEvent: public TPrsManageEvent {
+ public:
+ typedef bool TResult;
+ TResult myResult;
+ TGetShadedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
+ TPrsManageEvent(theView3D, thePrs), myResult(false) {}
+ virtual void Execute() {
+ if (VISU_Actor* anActor = GetMyActor())
+ if (VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor))
+ myResult = aScalarMapActor->IsShading();
+ }
+ };
+
+ class TGetOpacityEvent: public TPrsManageEvent {
+ public:
+ typedef double TResult;
+ TResult myResult;
+ TGetOpacityEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
+ TPrsManageEvent(theView3D, thePrs), myResult(-1.0) {}
+ virtual void Execute() {
+ if (VISU_Actor* anActor = GetMyActor()) {
+ vtkFloatingPointType oldvalue = anActor->GetOpacity();
+ myResult = (double)oldvalue;
+ }
+ }
+ };
+
+ class TGetLineWidthEvent: public TPrsManageEvent {
+ public:
+ typedef double TResult;
+ TResult myResult;
+ TGetLineWidthEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
+ TPrsManageEvent(theView3D, thePrs), myResult(-1.0) {}
+ virtual void Execute() {
+ if (VISU_Actor* anActor = GetMyActor()) {
+ vtkFloatingPointType oldvalue = anActor->GetLineWidth();
+ myResult = (double)oldvalue;
+ }
+ }
+ };
+
+ // Set
+ class TSetPrsTypeEvent: public TPrsManageEvent {
+ private:
+ PresentationType myPrsType;
+ public:
+ typedef string TResult;
+ TResult myResult;
+ TSetPrsTypeEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, PresentationType thePrsType):
+ TPrsManageEvent(theView3D, thePrs), myPrsType(thePrsType),
+ myResult("Unknown error occured")
+ {}
+ virtual void Execute() {
+ switch (myPrsType) {
+ case VISU::INSIDEFRAME:
+ {
+ VISU::VISUType aType = myPrs->GetType();
+ if (aType != VISU::TSCALARMAP &&
+ aType != VISU::TDEFORMEDSHAPE &&
+ aType != VISU::TSCALARMAPONDEFORMEDSHAPE) {
+ myResult = "Insideframe representation is not available for this type of presentations.";
+ return;
+ }
+ }
+ break;
+ case VISU::SURFACEFRAME:
+ myResult = "Surfaceframe representation is available only for mesh presentation.";
+ return;
+ case VISU::SHRINK:
+ myResult = "Use SetShrinked() method to shrink/unshrink presentation.";
+ return;
+ default:
+ break;
+ }
+ if (VISU_Actor* anActor = GetMyActor()) {
+ anActor->SetRepresentation((int)myPrsType);
+ SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
+ vw->Repaint();
+ myResult = "";
+ } else {
+ myResult = myError;
+ }
+ }
+ };
+
+ class TSetShrinkedEvent: public TPrsManageEvent {
+ private:
+ bool myIsOn;
+ public:
+ typedef string TResult;
+ TResult myResult;
+ TSetShrinkedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, bool isOn):
+ TPrsManageEvent(theView3D, thePrs), myIsOn(isOn),
+ myResult("Unknown error occured")
+ {}
+ virtual void Execute() {
+ VISU::VISUType aType = myPrs->GetType();
+ if (aType == VISU::TVECTORS || aType == VISU::TSTREAMLINES) {
+ myResult = "Shrinked representation is not available for this type of presentations.";
+ } else {
+ if (VISU_Actor* anActor = GetMyActor()) {
+ if (anActor->IsShrunkable()) {
+ if (myIsOn) anActor->SetShrink();
+ else anActor->UnShrink();
+ SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
+ vw->Repaint();
+ myResult = "";
+ } else {
+ myResult = "This presentation is not shrunkable.";
+ }
+ } else {
+ myResult = myError;
+ }
+ }
+ }
+ };
+
+ class TSetShadedEvent: public TPrsManageEvent {
+ private:
+ bool myIsOn;
+ public:
+ typedef string TResult;
+ TResult myResult;
+ TSetShadedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, bool isOn):
+ TPrsManageEvent(theView3D, thePrs), myIsOn(isOn),
+ myResult("Unknown error occured")
+ {}
+ virtual void Execute() {
+ if (VISU_Actor* anActor = GetMyActor()) {
+ if (VISU_ScalarMapAct* aScalarMapActor =
+ dynamic_cast<VISU_ScalarMapAct*>(anActor)) {
+ aScalarMapActor->SetShading(myIsOn);
+ SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
+ vw->Repaint();
+ myResult = "";
+ } else {
+ myResult = "Corrupted actor";
+ }
+ } else {
+ myResult = myError;
+ }
+ }
+ };
+
+ class TSetOpacityEvent: public TPrsManageEvent {
+ private:
+ double myOpacity;
+ public:
+ typedef string TResult;
+ TResult myResult;
+ TSetOpacityEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, double theOpacity):
+ TPrsManageEvent(theView3D, thePrs), myOpacity(theOpacity),
+ myResult("Unknown error occured")
+ {}
+ virtual void Execute() {
+ VISU::VISUType aType = myPrs->GetType();
+ if (aType == VISU::TVECTORS || aType == VISU::TSTREAMLINES) {
+ myResult = "Opacity is meaningless for this type of presentations.";
+ return;
+ }
+ if (VISU_Actor* anActor = GetMyActor()) {
+ anActor->SetOpacity((vtkFloatingPointType)myOpacity);
+ SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
+ vw->Repaint();
+ myResult = "";
+ } else {
+ myResult = myError;
+ }
+ }
+ };
+
+ class TSetLineWidthEvent: public TPrsManageEvent {
+ private:
+ double myLineWidth;
+ public:
+ typedef string TResult;
+ TResult myResult;
+ TSetLineWidthEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, double theLineWidth):
+ TPrsManageEvent(theView3D, thePrs), myLineWidth(theLineWidth),
+ myResult("Unknown error occured")
+ {}
+ virtual void Execute() {
+ if (myPrs->GetType() == VISU::TVECTORS) {
+ myResult = "Line Width is meaningless for Vectors presentation.";
+ return;
+ }
+ if (VISU_Actor* anActor = GetMyActor()) {
+ anActor->SetLineWidth((vtkFloatingPointType)myLineWidth);
+ SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
+ vw->Repaint();
+ myResult = "";
+ } else {
+ myResult = myError;
+ }
+ }
+ };
+
+ PresentationType View3D_i::GetPresentationType(ScalarMap_ptr thePrs)
+ {
+ return ProcessEvent(new TGetPrsTypeEvent(this,thePrs));
+ }
+ CORBA::Boolean View3D_i::IsShrinked(ScalarMap_ptr thePrs)
+ {
+ return ProcessEvent(new TGetShrinkedEvent(this,thePrs));
+ }
+ CORBA::Boolean View3D_i::IsShaded(ScalarMap_ptr thePrs)
+ {
+ return ProcessEvent(new TGetShadedEvent(this,thePrs));
+ }
+ CORBA::Double View3D_i::GetOpacity(ScalarMap_ptr thePrs)
+ {
+ return ProcessEvent(new TGetOpacityEvent(this,thePrs));
+ }
+ CORBA::Double View3D_i::GetLineWidth(ScalarMap_ptr thePrs)
+ {
+ return ProcessEvent(new TGetLineWidthEvent(this,thePrs));
+ }
+
+ char* View3D_i::SetPresentationType(ScalarMap_ptr thePrs, PresentationType thePrsType)
+ {
+ string aRet = ProcessEvent(new TSetPrsTypeEvent(this,thePrs,thePrsType));
+ return CORBA::string_dup(aRet.c_str());
+ }
+ char* View3D_i::SetShrinked(ScalarMap_ptr thePrs, CORBA::Boolean isShrinked)
+ {
+ string aRet = ProcessEvent(new TSetShrinkedEvent(this,thePrs,isShrinked));
+ return CORBA::string_dup(aRet.c_str());
+ }
+ char* View3D_i::SetShaded(ScalarMap_ptr thePrs, CORBA::Boolean isShaded)
+ {
+ string aRet = ProcessEvent(new TSetShadedEvent(this,thePrs,isShaded));
+ return CORBA::string_dup(aRet.c_str());
+ }
+ char* View3D_i::SetOpacity(ScalarMap_ptr thePrs, CORBA::Double theOpacity)
+ {
+ string aRet = ProcessEvent(new TSetOpacityEvent(this,thePrs,theOpacity));
+ return CORBA::string_dup(aRet.c_str());
+ }
+ char* View3D_i::SetLineWidth(ScalarMap_ptr thePrs, CORBA::Double theLineWidth)
+ {
+ string aRet = ProcessEvent(new TSetLineWidthEvent(this,thePrs,theLineWidth));
+ return CORBA::string_dup(aRet.c_str());
+ }
}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_View_i.hh
virtual void Close();
+ // Certain presentation view parameters management
+ virtual PresentationType GetPresentationType(ScalarMap_ptr thePrs);
+ virtual CORBA::Boolean IsShrinked (ScalarMap_ptr thePrs);
+ virtual CORBA::Boolean IsShaded (ScalarMap_ptr thePrs);
+ virtual CORBA::Double GetOpacity (ScalarMap_ptr thePrs);
+ virtual CORBA::Double GetLineWidth (ScalarMap_ptr thePrs);
+
+ virtual char* SetPresentationType(ScalarMap_ptr thePrs, PresentationType thePrsType);
+ virtual char* SetShrinked (ScalarMap_ptr thePrs, CORBA::Boolean isShrinked);
+ virtual char* SetShaded (ScalarMap_ptr thePrs, CORBA::Boolean isShaded);
+ virtual char* SetOpacity (ScalarMap_ptr thePrs, CORBA::Double theOpacity);
+ virtual char* SetLineWidth (ScalarMap_ptr thePrs, CORBA::Double theLineWidth);
+
protected:
static int myNbViewParams;
# 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
-#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
#
# File : Makefile.in
# Author : Paul RASCLE, EDF
# Module : VISU
-# $Header$
top_srcdir=@top_srcdir@
top_builddir=../..
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 test_events.py batch_test_events.py visu_split_views.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_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
LIB_CLIENT_IDL =
-CPPFLAGS += -ftemplate-depth-32 $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(QT_INCLUDES) \
- $(VTK_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome \
- -I${MED_ROOT_DIR}/include/salome \
+CPPFLAGS += -ftemplate-depth-32 \
+ $(PYTHON_INCLUDES) \
+ $(HDF5_INCLUDES) \
+ $(QT_INCLUDES) \
+ $(VTK_INCLUDES) \
+ $(KERNEL_CXXFLAGS) \
+ $(GUI_CXXFLAGS) \
+ $(MED_CXXFLAGS) \
$(BOOST_CPPFLAGS)
LDFLAGS += $(PYTHON_LIBS) -lVisuConvertor -lVisuPipeLine
+# Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
# T 2.23, 28: Displaying fields (scalar and vectorial) on nodes, change presentation options.
# Uses MED files ResOK_0000.med and Fields_group3D.med
#
cutplanes.SetOrientation(VISU.CutPlanes.YZ, 0, 0)
myView.DisplayOnly(cutplanes)
+print "Creating Scalar Map On Deformed Shape.......",
+scalarmapondefshape = myVisu.ScalarMapOnDeformedShapeOnField(myResult,myMeshName,myNodeEntity,'vitesse',1);
+if scalarmapondefshape is None : print "Error"
+else : print "OK"
+scalarmapondefshape.SetScalarField(myMeshName,'pression',2,myCellEntity);
+myView.DisplayOnly(scalarmapondefshape)
+
#%====================Stage4: Opening a new study and Med file import====================%
# Opening a new study tempoparily commented due to a problem
cutplanes1.SetOrientation(VISU.CutPlanes.YZ, 0, 0)
myView1.DisplayOnly(cutplanes1)
+print "Creating Scalar Map On Deformed Shape.......",
+scalarmapondefshape1 = myVisu.ScalarMapOnDeformedShapeOnField(myResult1,myMeshName1,myCellEntity,'vectoriel field',1);
+if scalarmapondefshape1 is None : print "Error"
+else : print "OK"
+myView1.DisplayOnly(scalarmapondefshape1)
#%====================Stage6: Object browser popup====================%
print "**** Stage6: Object browser popup"
+# Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
# T 2.24: Save/retrieve view parameters.
# Uses MED file fra.med from ${DATA_DIR}/MedFiles directory.
#
+# Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
# Animation of "vitesse" field, stored in file TimeStamps.med
#
# This script is equivalent to non-regression test script 003/A5
+# Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
# Show some results presentations in different 3D and 2D viewers
# with different options (view parameters and display modes).
# Uses MED files fra.med and TimeStamps.med from ${DATA_DIR}/MedFiles directory.
anAnim = myVisu.CreateAnimation(myView);
aSObj = myStudy.FindObjectIOR(myResult.GetID())
aSObj = aSObj.FindSubObject(1)[1]
-aSObj = aSObj.FindSubObject(2)[1]
+aSObj = aSObj.FindSubObject(3)[1]
aSObj = aSObj.FindSubObject(2)[1]
anAnim.addField(aSObj)
anAnim.setPresentationType(0,VISU.TISOSURFACE)
+# Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
# Create a table and show it in Plot2d viewer
#
# This script is equivalent to script VISU_SWIG/visu_big_table.py
+# Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
# Import a table from file and show it in Plot2d viewer
import salome
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_Gen_s.cc
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_Gen_s.hh
+# Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
"""
"""
+# Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
###############################################################
#
# File : batch_test_events.py
# VISU VISU_SWIG : binding of C++ implementation and Python
#
-# Copyright (C) 2003 CEA/DEN, EDF R&D
-#
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : batchmode_visu.py
# Module : VISU
# VISU VISU_SWIG : binding of C++ implementation and Python
#
-# Copyright (C) 2003 CEA/DEN, EDF R&D
-#
-#
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : visu_big_table.py
# Author : Vadim SANDLER
# VISU VISU_SWIG : binding of C++ implementation and Python
#
-# Copyright (C) 2003 CEA/DEN, EDF R&D
-#
-#
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : test_table.py
# Author : Alexey Petrov
# Module : VISU
-# $Header:
from VISU import *
from batchmode_visu_table import *
# VISU VISU_SWIG : binding of C++ implementation and Python
#
-# Copyright (C) 2003 CEA/DEN, EDF R&D
-#
-#
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : batchmode_visu_view3d.py
# Module : VISU
anAnim = myVisu.CreateAnimation(myView);
aSObj = myStudy.FindObjectIOR(myResult.GetID())
aSObj = aSObj.FindSubObject(1)[1]
-aSObj = aSObj.FindSubObject(2)[1]
+aSObj = aSObj.FindSubObject(3)[1]
aSObj = aSObj.FindSubObject(2)[1]
anAnim.addField(aSObj)
anAnim.setPresentationType(0,VISU.TISOSURFACE)
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
+# Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
###############################################################
#
# File : test_events.py
# VISU VISU_SWIG : binding of C++ implementation and Python
#
-# Copyright (C) 2003 CEA/DEN, EDF R&D
-#
-#
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : visu.py
# Module : VISU
pass
return aSComponent;
+
+def SetName(theObj, theName):
+ anIOR = myORB.object_to_string(theObj)
+ aSObj = myLocalStudy.FindObjectIOR(anIOR)
+ anAttr = aSObj.FindAttribute("AttributeName")[1]
+ anAttr.SetValue(theName)
def StrToMap(theString) :
aPairList = split(theString,";")
while aFolderIter.More() :
aFolderSObj = aFolderIter.Value()
aFolderIter.Next()
- anAttr = aFolderSObj.FindAttribute("AttributeName")[1]
+ anIsFound, anAttr = aFolderSObj.FindAttribute("AttributeName")
+ if not anIsFound :
+ continue
anAttr = anAttr._narrow(SALOMEDS.AttributeName);
aFolderName = anAttr.Value()
print " ", aFolderName
aPrsObj.RemoveFromStudy()
else :
aVISUObjList.append(aPrsObj)
+
+ if HasValue(thePrsTypeList,VISU.TSCALARMAPONDEFORMEDSHAPE) :
+ print " Creating ScalarMapOnDeformedShapeOnField",
+ aPrsObj = theVisu.ScalarMapOnDeformedShapeOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
+ if aPrsObj is None : print "Error"
+ else :
+ print ",OK"
+ theView.DisplayOnly(aPrsObj)
+ theView.FitAll()
+ aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TSCALARMAPONDEFORMEDSHAPE." + thePictureExt
+ aPictureName = re.sub("\s+","_", aPictureName)
+ theView.SavePicture(aPictureName)
+ if theIsAutoDelete :
+ aPrsObj.RemoveFromStudy()
+ else :
+ aVISUObjList.append(aPrsObj)
+
return aVISUObjList
# VISU VISU_SWIG : binding of C++ implementation and Python
#
-# Copyright (C) 2003 CEA/DEN, EDF R&D
-#
-#
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : visu_big_table.py
# Author : Vadim SANDLER
+# Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
import VISU
import SALOMEDS
from visu_gui import *
# VISU VISU_SWIG : binding of C++ implementation and Python
#
-# Copyright (C) 2003 CEA/DEN, EDF R&D
-#
-#
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : visu_gui.py
# Module : VISU
# VISU VISU_SWIG : binding of C++ implementation and Python
#
-# Copyright (C) 2003 CEA/DEN, EDF R&D
-#
-#
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : visu_med.py
# Module : VISU
import SALOME_MED
import VISU
-from libSALOME_Swig import *
-sg = SALOMEGUI_Swig()
+if salome.hasDesktop():
+ from libSALOME_Swig import *
+ sg = SALOMEGUI_Swig()
def getMedObjectFromStudy():
mySO = salome.myStudy.FindObject("Objet MED")
def importMedFrom(medDir,medFile):
medFile = medDir + medFile
med_comp.readStructFileWithFieldType(medFile,salome.myStudyName)
- sg.updateObjBrowser(1)
+ if salome.hasDesktop():
+ sg.updateObjBrowser(1)
def importMed(medFile):
importMedFrom(medDir,medFile)
# VISU VISU_SWIG : binding of C++ implementation and Python
#
-# Copyright (C) 2003 CEA/DEN, EDF R&D
-#
-#
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : visu_prs_exam.py
# Module : VISU
import SALOME_MED
import VISU
-from libSALOME_Swig import *
-sg = SALOMEGUI_Swig()
-
+if salome.hasDesktop():
+ from libSALOME_Swig import *
+ sg = SALOMEGUI_Swig()
import visu_gui
myVisu = visu_gui.myVisu
aScalarMap2 = myVisu.ScalarMapOnField(myResult2, aMeshName, anEntity, myField.getName(), aTimeStampId)
if(myField.getNumberOfComponents() > 1) :
aCutPlanes = myVisu.CutPlanesOnField(myResult2, aMeshName, anEntity, myField.getName(), aTimeStampId)
-
- sg.updateObjBrowser(0)
+ if salome.hasDesktop():
+ sg.updateObjBrowser(0)
else : print "We have no permission to rewrite medFile, so readStructFileWithFieldType can't open this file";
else : print "We have no permission to read medFile, it will not be opened";
except:
+# Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
import VISU
import SALOMEDS
+# Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
from libVISU_Swig import *
medFile = os.getenv('DATA_DIR') + '/MedFiles/fra.med'
myCon=Convertor(medFile)
# VISU VISU_SWIG : binding of C++ implementation and Python
#
-# Copyright (C) 2003 CEA/DEN, EDF R&D
-#
-#
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : visu_table.py
# Author : Vadim SANDLER
# VISU VISU_SWIG : binding of C++ implementation and Python
#
-# Copyright (C) 2003 CEA/DEN, EDF R&D
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-#
-#
-# File : test_table.py
+# File : visu_view.py
# Author : Alexey Petrov
# Module : VISU
-# $Header:
import SALOMEDS
import VISU
# VISU VISU_SWIG : binding of C++ implementation and Python
#
-# Copyright (C) 2003 CEA/DEN, EDF R&D
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-#
-#
-# File : batchmode_visu_view3d.py
+# File : visu_view3d.py
# Module : VISU
import os
anAnim = myVisu.CreateAnimation(myView);
aSObj = myStudy.FindObjectIOR(myResult.GetID())
aSObj = aSObj.FindSubObject(1)[1]
-aSObj = aSObj.FindSubObject(2)[1]
+aSObj = aSObj.FindSubObject(3)[1]
aSObj = aSObj.FindSubObject(2)[1]
anAnim.addField(aSObj)
anAnim.setPresentationType(0,VISU.TISOSURFACE)
+# Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
# File : Makefile.in
# Author : Alexander Solovyov(OCN)
# Module : VVTK
$(OCC_INCLUDES) \
$(VTK_INCLUDES) \
$(BOOST_CPPFLAGS) \
- -I$(KERNEL_ROOT_DIR)/include/salome \
- -I$(GUI_ROOT_DIR)/include/salome \
- -I${MED_ROOT_DIR}/include/salome
+ $(KERNEL_CXXFLAGS) \
+ $(GUI_CXXFLAGS) \
+ $(MED_CXXFLAGS)
LDFLAGS += \
$(QT_MT_LIBS) \
$(OCC_LIBS) \
$(VTK_LIBS) \
- -L$(KERNEL_ROOT_DIR)/lib/salome \
- -L$(GUI_ROOT_DIR)/lib/salome
+ $(KERNEL_LDFLAGS) \
+ $(GUI_LDFLAGS)
LIBS+= -lsuit -lCAM -lSalomeObject -lSVTK -lOpUtil
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#ifdef WNT
#ifdef VISU_VVTK_EXPORTS
#define VVTK_EXPORT __declspec(dllexport)
-// SALOME VTKViewer : build VTK viewer into Salome desktop\r
-//\r
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS \r
-// \r
-// This library is free software; you can redistribute it and/or \r
-// modify it under the terms of the GNU Lesser General Public \r
-// License as published by the Free Software Foundation; either \r
-// version 2.1 of the License. \r
-// \r
-// This library is distributed in the hope that it will be useful, \r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of \r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \r
-// Lesser General Public License for more details. \r
-// \r
-// You should have received a copy of the GNU Lesser General Public \r
-// License along with this library; if not, write to the Free Software \r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA \r
-// \r
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org \r
-//\r
-//\r
-//\r
-// File :\r
-// Author :\r
-// Module :\r
-// $Header$\r
-\r
-#include "VVTK_ImageWriter.h"\r
-\r
-#include <qsemaphore.h>\r
-\r
-#include <vtkImageData.h>\r
-#include <vtkImageClip.h>\r
-#include <vtkJPEGWriter.h>\r
-#include <vtkSmartPointer.h>\r
-\r
-#ifdef _DEBUG_\r
-static int MYDEBUG = 0;\r
-#else\r
-static int MYDEBUG = 0;\r
-#endif\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-VVTK_ImageWriter\r
-::VVTK_ImageWriter(QSemaphore* theSemaphore,\r
- vtkImageData* theImageData,\r
- const std::string& theName,\r
- int theProgressive,\r
- int theQuality):\r
- mySemaphore(theSemaphore),\r
- myImageData(theImageData),\r
- myName(theName),\r
- myProgressive(theProgressive),\r
- myQuality(theQuality),\r
- myConstraint16Flag(true)\r
-{}\r
-\r
-//----------------------------------------------------------------------------\r
-VVTK_ImageWriter\r
-::~VVTK_ImageWriter()\r
-{\r
- if(MYDEBUG) cout<<"VVTK_ImageWriter::~VVTK_ImageWriter - this = "<<this<<endl;\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_ImageWriter\r
-::run()\r
-{\r
- vtkJPEGWriter *aWriter = vtkJPEGWriter::New();\r
- vtkImageData *anImageData = myImageData;\r
- vtkSmartPointer<vtkImageClip> anImageClip;\r
- //\r
- if(myConstraint16Flag){ \r
- int uExtent[6];\r
- myImageData->GetUpdateExtent(uExtent);\r
- unsigned int width = uExtent[1] - uExtent[0] + 1;\r
- unsigned int height = uExtent[3] - uExtent[2] + 1;\r
- width = (width / 16) * 16;\r
- height= (height / 16) * 16;\r
- uExtent[1] = uExtent[0] + width - 1;\r
- uExtent[3] = uExtent[2] + height - 1;\r
- //\r
- anImageClip = vtkImageClip::New();\r
- anImageClip->Delete();\r
-\r
- anImageClip->SetInput(myImageData);\r
- anImageClip->SetOutputWholeExtent(uExtent);\r
- anImageClip->ClipDataOn();\r
- anImageData = anImageClip->GetOutput();\r
- }\r
- //\r
- aWriter->WriteToMemoryOff();\r
- aWriter->SetFileName(myName.c_str());\r
- aWriter->SetQuality(myQuality);\r
- aWriter->SetProgressive(myProgressive);\r
- aWriter->SetInput(anImageData);\r
- aWriter->Write();\r
-\r
- aWriter->Delete();\r
- myImageData->Delete();\r
-\r
- if(MYDEBUG) cout<<"VVTK_ImageWriter::run "<<\r
- "- this = "<<this<<\r
- "; total = "<<mySemaphore->total()<<\r
- "; available = "<<mySemaphore->available()<<endl;\r
- *mySemaphore -= 1;\r
-}\r
-\r
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File :
+// Author :
+// Module :
+// $Header$
+
+#include "VVTK_ImageWriter.h"
+
+#include <qsemaphore.h>
+
+#include <vtkImageData.h>
+#include <vtkImageClip.h>
+#include <vtkJPEGWriter.h>
+#include <vtkSmartPointer.h>
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+
+//----------------------------------------------------------------------------
+VVTK_ImageWriter
+::VVTK_ImageWriter(QSemaphore* theSemaphore,
+ vtkImageData* theImageData,
+ const std::string& theName,
+ int theProgressive,
+ int theQuality):
+ mySemaphore(theSemaphore),
+ myImageData(theImageData),
+ myName(theName),
+ myProgressive(theProgressive),
+ myQuality(theQuality),
+ myConstraint16Flag(true)
+{}
+
+//----------------------------------------------------------------------------
+VVTK_ImageWriter
+::~VVTK_ImageWriter()
+{
+ if(MYDEBUG) cout<<"VVTK_ImageWriter::~VVTK_ImageWriter - this = "<<this<<endl;
+}
+
+
+//----------------------------------------------------------------------------
+void
+VVTK_ImageWriter
+::run()
+{
+ vtkJPEGWriter *aWriter = vtkJPEGWriter::New();
+ vtkImageData *anImageData = myImageData;
+ vtkSmartPointer<vtkImageClip> anImageClip;
+ //
+ if(myConstraint16Flag){
+ int uExtent[6];
+ myImageData->GetUpdateExtent(uExtent);
+ unsigned int width = uExtent[1] - uExtent[0] + 1;
+ unsigned int height = uExtent[3] - uExtent[2] + 1;
+ width = (width / 16) * 16;
+ height= (height / 16) * 16;
+ uExtent[1] = uExtent[0] + width - 1;
+ uExtent[3] = uExtent[2] + height - 1;
+ //
+ anImageClip = vtkImageClip::New();
+ anImageClip->Delete();
+
+ anImageClip->SetInput(myImageData);
+ anImageClip->SetOutputWholeExtent(uExtent);
+ anImageClip->ClipDataOn();
+ anImageData = anImageClip->GetOutput();
+ }
+ //
+ aWriter->WriteToMemoryOff();
+ aWriter->SetFileName(myName.c_str());
+ aWriter->SetQuality(myQuality);
+ aWriter->SetProgressive(myProgressive);
+ aWriter->SetInput(anImageData);
+ aWriter->Write();
+
+ aWriter->Delete();
+ myImageData->Delete();
+
+ if(MYDEBUG) cout<<"VVTK_ImageWriter::run "<<
+ "- this = "<<this<<
+ "; total = "<<mySemaphore->total()<<
+ "; available = "<<mySemaphore->available()<<endl;
+ *mySemaphore -= 1;
+}
+
-// SALOME VTKViewer : build VTK viewer into Salome desktop\r
-//\r
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS \r
-// \r
-// This library is free software; you can redistribute it and/or \r
-// modify it under the terms of the GNU Lesser General Public \r
-// License as published by the Free Software Foundation; either \r
-// version 2.1 of the License. \r
-// \r
-// This library is distributed in the hope that it will be useful, \r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of \r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \r
-// Lesser General Public License for more details. \r
-// \r
-// You should have received a copy of the GNU Lesser General Public \r
-// License along with this library; if not, write to the Free Software \r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA \r
-// \r
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org \r
-//\r
-//\r
-//\r
-// File :\r
-// Author :\r
-// Module :\r
-// $Header$\r
-\r
-\r
-#ifndef _VVTK_ImageWriter_Header_File_\r
-#define _VVTK_ImageWriter_Header_File_\r
-\r
-#include <qthread.h>\r
-#include <string>\r
-\r
-class vtkImageData;\r
-class QSemaphore;\r
-\r
-\r
-class VVTK_ImageWriter : public QThread \r
-{\r
-public:\r
- VVTK_ImageWriter(QSemaphore* theSemaphore,\r
- vtkImageData* theImageData,\r
- const std::string& theName,\r
- int theProgressive,\r
- int theQuality);\r
-\r
- ~VVTK_ImageWriter();\r
-\r
- protected:\r
- virtual\r
- void\r
- run();\r
- \r
- protected:\r
- QSemaphore* mySemaphore;\r
- vtkImageData *myImageData;\r
- std::string myName;\r
- int myProgressive;\r
- int myQuality;\r
- bool myConstraint16Flag;\r
-};\r
-#endif\r
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File :
+// Author :
+// Module :
+// $Header$
+
+
+#ifndef _VVTK_ImageWriter_Header_File_
+#define _VVTK_ImageWriter_Header_File_
+
+#include <qthread.h>
+#include <string>
+
+class vtkImageData;
+class QSemaphore;
+
+
+class VVTK_ImageWriter : public QThread
+{
+public:
+ VVTK_ImageWriter(QSemaphore* theSemaphore,
+ vtkImageData* theImageData,
+ const std::string& theName,
+ int theProgressive,
+ int theQuality);
+
+ ~VVTK_ImageWriter();
+
+ protected:
+ virtual
+ void
+ run();
+
+ protected:
+ QSemaphore* mySemaphore;
+ vtkImageData *myImageData;
+ std::string myName;
+ int myProgressive;
+ int myQuality;
+ bool myConstraint16Flag;
+};
+#endif
-// SALOME VTKViewer : build VTK viewer into Salome desktop\r
-//\r
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS \r
-// \r
-// This library is free software; you can redistribute it and/or \r
-// modify it under the terms of the GNU Lesser General Public \r
-// License as published by the Free Software Foundation; either \r
-// version 2.1 of the License. \r
-// \r
-// This library is distributed in the hope that it will be useful, \r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of \r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \r
-// Lesser General Public License for more details. \r
-// \r
-// You should have received a copy of the GNU Lesser General Public \r
-// License along with this library; if not, write to the Free Software \r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA \r
-// \r
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org \r
-//\r
-//\r
-//\r
-// File :\r
-// Author :\r
-// Module :\r
-// $Header$\r
-\r
-#include "VVTK_ImageWriterMgr.h"\r
-#include "VVTK_ImageWriter.h"\r
-\r
-#include <vtkImageData.h>\r
-\r
-#include <qsemaphore.h>\r
-\r
-#include <limits>\r
-\r
-\r
-#ifdef _DEBUG_\r
-static int MYDEBUG = 0;\r
-#else\r
-static int MYDEBUG = 0;\r
-#endif\r
-\r
-//----------------------------------------------------------------------------\r
-VVTK_ImageWriterMgr\r
-::VVTK_ImageWriterMgr()\r
-{\r
- int aMax = std::numeric_limits<int>::max() / 2;\r
- mySemaphore = new QSemaphore(aMax);\r
- *mySemaphore += aMax;\r
- if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<<\r
- "- total = "<<mySemaphore->total()<<\r
- "; available = "<<mySemaphore->available()<<endl;\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-VVTK_ImageWriterMgr\r
-::~VVTK_ImageWriterMgr()\r
-{\r
- Stop();\r
- delete mySemaphore;\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_ImageWriterMgr\r
-::StartImageWriter(vtkImageData *theImageData,\r
- const std::string& theName,\r
- const int theProgressive,\r
- const int theQuality)\r
-{\r
- VVTK_ImageWriter *anImageWriter = \r
- new VVTK_ImageWriter(mySemaphore,\r
- theImageData,\r
- theName,\r
- theProgressive,\r
- theQuality);\r
- myThreads.push_back(anImageWriter);\r
-\r
- anImageWriter->start();\r
-\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_ImageWriterMgr\r
-::Stop()\r
-{\r
- if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop "<<\r
- "- total = "<<mySemaphore->total()<<\r
- "; available = "<<mySemaphore->available()<<endl;\r
- if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop - *mySemaphore += "<<myThreads.size()<<endl;\r
- *mySemaphore += myThreads.size();\r
-\r
- for(size_t anId = 0, anEnd = myThreads.size(); anId < anEnd; anId++){\r
- VVTK_ImageWriter* anImageWriter = myThreads[anId];\r
- anImageWriter->wait();\r
- delete anImageWriter;\r
- }\r
- myThreads.clear();\r
-}\r
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File :
+// Author :
+// Module :
+// $Header$
+
+#include "VVTK_ImageWriterMgr.h"
+#include "VVTK_ImageWriter.h"
+
+#include <vtkImageData.h>
+
+#include <qsemaphore.h>
+
+#include <limits>
+
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+//----------------------------------------------------------------------------
+VVTK_ImageWriterMgr
+::VVTK_ImageWriterMgr()
+{
+ int aMax = std::numeric_limits<int>::max() / 2;
+ mySemaphore = new QSemaphore(aMax);
+ *mySemaphore += aMax;
+ if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<<
+ "- total = "<<mySemaphore->total()<<
+ "; available = "<<mySemaphore->available()<<endl;
+}
+
+
+//----------------------------------------------------------------------------
+VVTK_ImageWriterMgr
+::~VVTK_ImageWriterMgr()
+{
+ Stop();
+ delete mySemaphore;
+}
+
+
+//----------------------------------------------------------------------------
+void
+VVTK_ImageWriterMgr
+::StartImageWriter(vtkImageData *theImageData,
+ const std::string& theName,
+ const int theProgressive,
+ const int theQuality)
+{
+ VVTK_ImageWriter *anImageWriter =
+ new VVTK_ImageWriter(mySemaphore,
+ theImageData,
+ theName,
+ theProgressive,
+ theQuality);
+ myThreads.push_back(anImageWriter);
+
+ anImageWriter->start();
+
+}
+
+
+//----------------------------------------------------------------------------
+void
+VVTK_ImageWriterMgr
+::Stop()
+{
+ if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop "<<
+ "- total = "<<mySemaphore->total()<<
+ "; available = "<<mySemaphore->available()<<endl;
+ if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop - *mySemaphore += "<<myThreads.size()<<endl;
+ *mySemaphore += myThreads.size();
+
+ for(size_t anId = 0, anEnd = myThreads.size(); anId < anEnd; anId++){
+ VVTK_ImageWriter* anImageWriter = myThreads[anId];
+ anImageWriter->wait();
+ delete anImageWriter;
+ }
+ myThreads.clear();
+}
-// SALOME VTKViewer : build VTK viewer into Salome desktop\r
-//\r
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS \r
-// \r
-// This library is free software; you can redistribute it and/or \r
-// modify it under the terms of the GNU Lesser General Public \r
-// License as published by the Free Software Foundation; either \r
-// version 2.1 of the License. \r
-// \r
-// This library is distributed in the hope that it will be useful, \r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of \r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \r
-// Lesser General Public License for more details. \r
-// \r
-// You should have received a copy of the GNU Lesser General Public \r
-// License along with this library; if not, write to the Free Software \r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA \r
-// \r
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org \r
-//\r
-//\r
-//\r
-// File :\r
-// Author :\r
-// Module :\r
-// $Header$\r
-\r
-#ifndef _VVTK_ImageWriterMgr_Header_File_\r
-#define _VVTK_ImageWriterMgr_Header_File_\r
-\r
-#include <string>\r
-#include <vector>\r
-\r
-class QString;\r
-class vtkImageData;\r
-class VVTK_ImageWriter;\r
-class QSemaphore;\r
-\r
-class VVTK_ImageWriterMgr\r
-{\r
- public:\r
- VVTK_ImageWriterMgr();\r
- ~VVTK_ImageWriterMgr();\r
- \r
- void\r
- StartImageWriter(vtkImageData *theImageData,\r
- const std::string& theName,\r
- const int theProgressive,\r
- const int theQuality);\r
-\r
- void\r
- Stop();\r
-\r
- typedef std::vector<VVTK_ImageWriter*> TWriterThreads;\r
-\r
- protected:\r
- TWriterThreads myThreads;\r
-\r
- QSemaphore* mySemaphore;\r
-};\r
-\r
-\r
-#endif\r
-\r
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File :
+// Author :
+// Module :
+// $Header$
+
+#ifndef _VVTK_ImageWriterMgr_Header_File_
+#define _VVTK_ImageWriterMgr_Header_File_
+
+#include <string>
+#include <vector>
+
+class QString;
+class vtkImageData;
+class VVTK_ImageWriter;
+class QSemaphore;
+
+class VVTK_ImageWriterMgr
+{
+ public:
+ VVTK_ImageWriterMgr();
+ ~VVTK_ImageWriterMgr();
+
+ void
+ StartImageWriter(vtkImageData *theImageData,
+ const std::string& theName,
+ const int theProgressive,
+ const int theQuality);
+
+ void
+ Stop();
+
+ typedef std::vector<VVTK_ImageWriter*> TWriterThreads;
+
+ protected:
+ TWriterThreads myThreads;
+
+ QSemaphore* mySemaphore;
+};
+
+
+#endif
+
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// Recording
myRecordingToolBar = new QToolBar(this);
myRecordingToolBar->setCloseMode(QDockWindow::Undocked);
- myRecordingToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
+ myRecordingToolBar->setLabel(tr("LBL_TOOLBAR_RECORD_LABEL"));
moveDockWindow(myRecordingToolBar,Qt::DockLeft);
myStartAction = new QtxAction(tr("MNU_VVTK_RECORDING_START"),
fmt = "JPEG";
QApplication::setOverrideCursor( Qt::waitCursor );
- bool res = img.save( fileName, fmt.latin1() );
+ img.save( fileName, fmt.latin1() );
QApplication::restoreOverrideCursor();
}
{
myPtsToolBar = new QToolBar(this);
myPtsToolBar->setCloseMode(QDockWindow::Undocked);
- myPtsToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
+ myPtsToolBar->setLabel(tr("LBL_TOOLBAR_GAUSS_LABEL"));
moveDockWindow(myPtsToolBar,Qt::DockLeft);
QPixmap aPixmap;
myPickingAction->addTo( myPtsToolBar );
connect(myPickingAction, SIGNAL(toggled(bool)), this, SLOT(OnSelectionModeSwitch(bool)));
- myPickingDlg = new VVTK_PickingDlg( this, "PickingDlg" );
- myPickingDlg->SetAction( myPickingAction );
+ myPickingDlg = new VVTK_PickingDlg( myPickingAction, this, "PickingDlg" );
// Plane/Sphere Segmentation
aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_PLANE_SEGMENTATION_SWITCH"));
VVTK_MainWindow1
::OnSelectionModeSwitch(bool theIsSelectionOn)
{
+ if ( theIsSelectionOn && !isVisible() )
+ return;
+
Selection_Mode aSelectionMode = SelectionMode();
if(theIsSelectionOn && aSelectionMode != GaussPointSelection)
SetSelectionMode(GaussPointSelection);
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#ifndef VVTK_MAINWINDOW_H
#define VVTK_MAINWINDOW_H
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VVTK_PickingDlg.cxx
// Author : Oleg Uvarov
#include "VISU_GaussPtsAct.h"
#include "VISU_GaussPtsSettings.h"
+#include "SUIT_MessageBox.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_Session.h"
+#include "SVTK_MainWindow.h"
#include "SVTK_RenderWindowInteractor.h"
#include <vtkActorCollection.h>
#include "QtxDblSpinBox.h"
#include "QtxIntSpinBox.h"
+#include "LightApp_Application.h"
+
using namespace std;
-VVTK_PickingDlg::VVTK_PickingDlg( QWidget* parent, const char* name )
- :QDialog( parent, name, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
- myEventCallbackCommand( vtkCallbackCommand::New() ),
- myPickingSettings( VISU_PickingSettings::New() )
+VVTK_PickingDlg::VVTK_PickingDlg(QtxAction* theAction,
+ SVTK_MainWindow* theParent,
+ const char* theName):
+ SVTK_DialogBase(theAction,
+ theParent,
+ theName),
+ myEventCallbackCommand( vtkCallbackCommand::New() ),
+ myPickingSettings( VISU_PickingSettings::New() )
{
myPriority = 0.0;
myEventCallbackCommand->Delete();
myEventCallbackCommand->SetClientData(this);
myEventCallbackCommand->SetCallback(VVTK_PickingDlg::ProcessEvents);
- SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
setCaption( tr( "PICKING_DLG_TITLE" ) );
setSizeGripEnabled(TRUE);
buttonClose->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonClose, 0, 2 );
+ QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" );
+ buttonHelp->setAutoDefault( TRUE );
+ GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
+
TopLayout->addWidget( aBox );
TopLayout->addWidget( GroupButtons );
connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onClickApply() ) );
connect( buttonClose, SIGNAL( clicked() ), this, SLOT( onClickClose() ) );
+ connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onClickHelp() ) );
}
VVTK_PickingDlg::~VVTK_PickingDlg()
myStepNumberSpinBox->setValue( myPickingSettings->GetStepNumber() );
myDisplayParentMeshCheckBox->setChecked( myPickingSettings->GetDisplayParentMesh() );
- float* aColor = myPickingSettings->GetColor();
+ vtkFloatingPointType* aColor = myPickingSettings->GetColor();
mySelectionColorButton->setPaletteBackgroundColor( QColor( ( int )( aColor[0] * 255.0 ),
( int )( aColor[1] * 255.0 ),
( int )( aColor[2] * 255.0 ) ) );
myPickingSettings->SetDisplayParentMesh( myDisplayParentMeshCheckBox->isChecked() );
QColor aButtonColor = mySelectionColorButton->paletteBackgroundColor();
- float aColor[3];
+ vtkFloatingPointType aColor[3];
aColor[0] = aButtonColor.red() / 255.0;
aColor[1] = aButtonColor.green() / 255.0;
aColor[2] = aButtonColor.blue() / 255.0;
void VVTK_PickingDlg::onClickClose()
{
- myAction->setOn( false );
reject();
}
-void VVTK_PickingDlg::done( int r )
+void VVTK_PickingDlg::onClickHelp()
{
- myAction->setOn( false );
- QDialog::done( r );
+ QString aHelpFileName = "picking.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
}
void VVTK_PickingDlg::onColorButtonPressed()
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VVTK_PickingDlg.h
// Author : Oleg Uvarov
#ifndef VVTK_PICKINGDLG_H
#define VVTK_PICKINGDLG_H
-#include <qdialog.h>
+#include "SVTK_DialogBase.h"
#include <vtkObject.h>
#include <vtkSmartPointer.h>
class VISU_GaussPtsAct;
class VISU_PickingSettings;
+class SVTK_MainWindow;
class SVTK_RenderWindowInteractor;
//! Picking Dialog.
* Uses for set up picking preferenses and apply
* them to all actors in the current renderer.
*/
-class VVTK_PickingDlg : public QDialog
+class VVTK_PickingDlg : public SVTK_DialogBase
{
Q_OBJECT
public:
- VVTK_PickingDlg( QWidget* parent = 0, const char* name = 0 );
- ~VVTK_PickingDlg();
+ VVTK_PickingDlg(QtxAction* theAction,
+ SVTK_MainWindow* theParent,
+ const char* theName);
- //! Used to switch toggle state of the Picking action.
- void SetAction( QtxAction* theAction ) { myAction = theAction; }
+ ~VVTK_PickingDlg();
//! Make an actor to listen the event of Update Picking Settings event.
void AddActor( VISU_GaussPtsAct* );
void SetInteractor( SVTK_RenderWindowInteractor* );
protected slots:
- virtual void done( int );
-
void onClickApply();
void onClickClose();
+ void onClickHelp();
void onColorButtonPressed();
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
{
myPaused = myPaused ? 0 : 1;
if(myPaused && !myFrameIndexes.empty()){
- size_t aLastId = myFrameIndexes.size() - 1;
- myFrameIndexes[aLastId] *= -1;
+ myFrameIndexes.back() *= -1;
+ if(MYDEBUG) cout<<"VVTK_Recorder::Pause - myFrameIndexes.back() = "<<myFrameIndexes.back()<<endl;
}
}
//----------------------------------------------------------------------------
+inline
+int
+GetFrameIndex(double theStartTime,
+ double theFPS)
+{
+ double aTimeNow = vtkTimerLog::GetCurrentTime();
+ double aDelta = aTimeNow - theStartTime;
+ return int(aDelta*theFPS);
+}
+
void
VVTK_Recorder
::DoRecord()
myFrameIndex = 0;
myTimeStart = vtkTimerLog::GetCurrentTime();
}else{
- double aTimeNow = vtkTimerLog::GetCurrentTime();
- double aDelta = aTimeNow - myTimeStart;
- if(aDelta < 0.0)
+ int aFrameIndex = GetFrameIndex(myTimeStart,myNbFPS);
+ if(aFrameIndex <= myFrameIndex)
return;
- int aFrameIndex = int(aDelta*myNbFPS);
- if(aFrameIndex == myFrameIndex)
+ // If there was a "pause" we correct the myTimeStart
+ int aLastFrameIndex = myFrameIndexes.back();
+ if(aLastFrameIndex < 0){
+ myFrameIndexes.back() = abs(myFrameIndexes.back());
+ double aPauseTime = fabs((double)aFrameIndex - (double)myFrameIndex - 1) / myNbFPS;
+ if(MYDEBUG)
+ cout<<"VVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
+ "; aPauseTime = "<<aPauseTime<<endl;
+ myTimeStart += aPauseTime;
+ }
+
+ aFrameIndex = GetFrameIndex(myTimeStart,myNbFPS);
+ if(aFrameIndex <= myFrameIndex)
return;
myFrameIndex = aFrameIndex;
if(MYDEBUG) cout<<"VVTK_Recorder::MakeFileAVI - "<<aString<<endl;
- QFileInfo aFileInfo(myName);
+ QFileInfo aFileInfo(myName.c_str());
QString aDirPath = aFileInfo.dirPath(TRUE);
QString aBaseName = aFileInfo.fileName();
QString aCommand =
" | xargs rm " +
")";
+ aCommand =
+ QString("rm ") + aDirPath + "/" + aBaseName + "*.jpeg";
+
if(MYDEBUG) cout<<"VVTK_Recorder::MakeFileAVI - "<<aCommand.latin1()<<endl;
system(aCommand.latin1());
}
-// SALOME VTKViewer : build VTK viewer into Salome desktop\r
-//\r
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS \r
-// \r
-// This library is free software; you can redistribute it and/or \r
-// modify it under the terms of the GNU Lesser General Public \r
-// License as published by the Free Software Foundation; either \r
-// version 2.1 of the License. \r
-// \r
-// This library is distributed in the hope that it will be useful, \r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of \r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \r
-// Lesser General Public License for more details. \r
-// \r
-// You should have received a copy of the GNU Lesser General Public \r
-// License along with this library; if not, write to the Free Software \r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA \r
-// \r
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org \r
-//\r
-//\r
-//\r
-// File : \r
-// Author : \r
-// Module : SALOME\r
-// $Header$\r
-\r
-#ifndef _VVTK_Recorder_Header_File_\r
-#define _VVTK_Recorder_Header_File_\r
-\r
-#include <list>\r
-#include <string>\r
-#include <vector>\r
-\r
-#include <vtkObject.h>\r
-\r
-class vtkRenderWindow;\r
-class vtkCallbackCommand;\r
-class vtkWindowToImageFilter;\r
-class VVTK_ImageWriterMgr;\r
-//\r
-class VVTK_Recorder : public vtkObject \r
-{\r
- protected:\r
- enum State {\r
- VVTK_Recorder_Unknown=0,\r
- VVTK_Recorder_Record,\r
- VVTK_Recorder_Stop\r
- };\r
- \r
- public:\r
- static VVTK_Recorder *New();\r
- vtkTypeRevisionMacro(VVTK_Recorder,vtkObject);\r
-\r
- void\r
- SetRenderWindow(vtkRenderWindow* theRenderWindow);\r
-\r
- vtkRenderWindow* \r
- RenderWindow();\r
-\r
- void \r
- SetName(const char *theName);\r
-\r
- const char* \r
- Name() const;\r
-\r
- void\r
- SetNbFPS(const double theNbFPS);\r
-\r
- double\r
- NbFPS() const;\r
-\r
- void\r
- SetQuality(int theQuality);\r
-\r
- int\r
- GetQuality() const;\r
-\r
- void\r
- SetProgressiveMode(bool theProgressiveMode);\r
-\r
- bool\r
- GetProgressiveMode() const;\r
-\r
- void\r
- SetUseSkippedFrames(bool theUseSkippedFrames);\r
-\r
- bool\r
- UseSkippedFrames() const;\r
-\r
- void\r
- Record();\r
-\r
- void\r
- Pause();\r
-\r
- void\r
- Stop();\r
-\r
- int\r
- State() const;\r
-\r
- int \r
- ErrorStatus() const;\r
-\r
- void\r
- CheckExistAVIMaker();\r
-\r
-protected :\r
- VVTK_Recorder();\r
-\r
- ~VVTK_Recorder();\r
-\r
- void\r
- DoRecord();\r
-\r
- void\r
- MakeFileAVI();\r
-\r
- void\r
- AddSkippedFrames();\r
-\r
- void\r
- PreWrite();\r
-\r
- static\r
- void\r
- ProcessEvents(vtkObject* theObject, \r
- unsigned long theEvent,\r
- void* theClientData, \r
- void* theCallData);\r
-\r
-protected :\r
- int myState;\r
- int myPaused;\r
- int myErrorStatus;\r
-\r
- float myPriority;\r
- double myTimeStart;\r
-\r
- int myFrameIndex;\r
- int myNbWrittenFrames;\r
-\r
- double myNbFPS;\r
- int myQuality;\r
- bool myProgressiveMode;\r
-\r
- typedef std::vector<int> TFrameIndexes;\r
- TFrameIndexes myFrameIndexes;\r
- bool myUseSkippedFrames;\r
-\r
- std::string myName;\r
- std::string myNameAVIMaker;\r
-\r
- vtkCallbackCommand *myCommand;\r
- vtkRenderWindow *myRenderWindow;\r
- vtkWindowToImageFilter *myFilter;\r
- VVTK_ImageWriterMgr *myWriterMgr;\r
-\r
-\r
-private:\r
- VVTK_Recorder(const VVTK_Recorder&); //Not implemented\r
- void operator=(const VVTK_Recorder&); //Not implemented\r
-};\r
-#endif\r
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File :
+// Author :
+// Module : SALOME
+// $Header$
+
+#ifndef _VVTK_Recorder_Header_File_
+#define _VVTK_Recorder_Header_File_
+
+#include <list>
+#include <string>
+#include <vector>
+
+#include <vtkObject.h>
+
+class vtkRenderWindow;
+class vtkCallbackCommand;
+class vtkWindowToImageFilter;
+class VVTK_ImageWriterMgr;
+//
+class VVTK_Recorder : public vtkObject
+{
+ protected:
+ enum State {
+ VVTK_Recorder_Unknown=0,
+ VVTK_Recorder_Record,
+ VVTK_Recorder_Stop
+ };
+
+ public:
+ static VVTK_Recorder *New();
+ vtkTypeRevisionMacro(VVTK_Recorder,vtkObject);
+
+ void
+ SetRenderWindow(vtkRenderWindow* theRenderWindow);
+
+ vtkRenderWindow*
+ RenderWindow();
+
+ void
+ SetName(const char *theName);
+
+ const char*
+ Name() const;
+
+ void
+ SetNbFPS(const double theNbFPS);
+
+ double
+ NbFPS() const;
+
+ void
+ SetQuality(int theQuality);
+
+ int
+ GetQuality() const;
+
+ void
+ SetProgressiveMode(bool theProgressiveMode);
+
+ bool
+ GetProgressiveMode() const;
+
+ void
+ SetUseSkippedFrames(bool theUseSkippedFrames);
+
+ bool
+ UseSkippedFrames() const;
+
+ void
+ Record();
+
+ void
+ Pause();
+
+ void
+ Stop();
+
+ int
+ State() const;
+
+ int
+ ErrorStatus() const;
+
+ void
+ CheckExistAVIMaker();
+
+protected :
+ VVTK_Recorder();
+
+ ~VVTK_Recorder();
+
+ void
+ DoRecord();
+
+ void
+ MakeFileAVI();
+
+ void
+ AddSkippedFrames();
+
+ void
+ PreWrite();
+
+ static
+ void
+ ProcessEvents(vtkObject* theObject,
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
+
+protected :
+ int myState;
+ int myPaused;
+ int myErrorStatus;
+
+ float myPriority;
+ double myTimeStart;
+
+ int myFrameIndex;
+ int myNbWrittenFrames;
+
+ double myNbFPS;
+ int myQuality;
+ bool myProgressiveMode;
+
+ typedef std::vector<int> TFrameIndexes;
+ TFrameIndexes myFrameIndexes;
+ bool myUseSkippedFrames;
+
+ std::string myName;
+ std::string myNameAVIMaker;
+
+ vtkCallbackCommand *myCommand;
+ vtkRenderWindow *myRenderWindow;
+ vtkWindowToImageFilter *myFilter;
+ VVTK_ImageWriterMgr *myWriterMgr;
+
+
+private:
+ VVTK_Recorder(const VVTK_Recorder&); //Not implemented
+ void operator=(const VVTK_Recorder&); //Not implemented
+};
+#endif
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "VVTK_Recorder.h"
#include "SUIT_FileDlg.h"
+#include "SUIT_MessageBox.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_Session.h"
#include "QtxDblSpinBox.h"
#include "QtxIntSpinBox.h"
+#include "LightApp_Application.h"
+
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qgroupbox.h>
aCloseButton->setAutoDefault( true );
CommonGroupLayout->addWidget( aCloseButton, 0, 2 );
+ QPushButton* aHelpButton = new QPushButton( tr( "HELP" ), CommonGroup );
+ aHelpButton->setAutoDefault( true );
+ CommonGroupLayout->addWidget( aHelpButton, 0, 3 );
+
connect( aStartButton, SIGNAL( clicked() ), this, SLOT( onStart() ) );
connect( aCloseButton, SIGNAL( clicked() ), this, SLOT( onClose() ) );
+ connect( aHelpButton, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
}
VVTK_RecorderDlg::~VVTK_RecorderDlg()
reject();
}
+void VVTK_RecorderDlg::onHelp()
+{
+ QString aHelpFileName = "animation_in_gauss_viewer.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
+
bool VVTK_RecorderDlg::onBrowseFile()
{
QString aRootDir = QString( getenv( "VISU_ROOT_DIR") );
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
protected slots:
void onStart();
void onClose();
+ void onHelp();
bool onBrowseFile();
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
}
std::ostringstream aStr;
float aFPS = 1.0 / aLastRenderTimeInSeconds;
- aStr<<"FPS: "<<aFPS<<"; NumberOfCells: "<<aNumberOfCells;
+ aStr<<"FPS: "<<aFPS<<"\n NumberOfCells: "<<aNumberOfCells;
std::string anInput = aStr.str();
SetInput(anInput.c_str());
return Superclass::RenderOpaqueGeometry(theViewport);
myFPSActor->SetMapper(aTextMapper);
aTextMapper->Delete();
- GetDevice()->AddActor2D(myFPSActor.GetPointer());
+ //GetDevice()->AddActor2D(myFPSActor.GetPointer());
myGaussPointPicker->Delete();
//----------------------------------------------------------------------------
VVTK_Renderer1::VVTK_Renderer1():
- //myImplicitFunctionWidget(VISU_ImplicitFunctionWidget::New()),
myWidgetCtrl(VISU_WidgetCtrl::New()),
myOutsideCursorSettings(NULL)
{
if(MYDEBUG) INFOS("VVTK_Renderer1() - "<<this);
- //myImplicitFunctionWidget->SetPlaceFactor(1.1);
myWidgetCtrl->SetPlaceFactor(1.1);
//
- VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget();
- pPlanesWidget->SetOutlineTranslation(false);
- vtkProperty* aSelectedPlaneProperty = pPlanesWidget->GetSelectedPlaneProperty();
- vtkProperty* aPlaneProperty = pPlanesWidget->GetPlaneProperty();
+ VISU_PlanesWidget *aPlanesWidget = myWidgetCtrl->GetPlanesWidget();
+ aPlanesWidget->SetOutlineTranslation(false);
+ vtkProperty* aSelectedPlaneProperty = aPlanesWidget->GetSelectedPlaneProperty();
+ vtkProperty* aPlaneProperty = aPlanesWidget->GetPlaneProperty();
aPlaneProperty->SetOpacity(aSelectedPlaneProperty->GetOpacity()*1.5);
//
myWidgetCtrl->Delete();
}
}
+
//----------------------------------------------------------------------------
void
VVTK_Renderer1
AdjustWidgetCtrl();
}
}
+
+
//----------------------------------------------------------------------------
-void VVTK_Renderer1::AdjustWidgetCtrl()
+void
+VVTK_Renderer1
+::AdjustWidgetCtrl()
{
- if(SVTK_Renderer::OnAdjustActors()){
- VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget();
- pPlanesWidget->InitialPlaceWidget(myBndBox);
- pPlanesWidget->SetOrigin(0.5*(myBndBox[1] + myBndBox[0]),
- 0.5*(myBndBox[3] + myBndBox[2]),
- 0.5*(myBndBox[5] + myBndBox[4]));
- //
- VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget();
- pSphereWidget->SetCenter(0.5*(myBndBox[1] + myBndBox[0]),
- 0.5*(myBndBox[3] + myBndBox[2]),
- 0.5*(myBndBox[5] + myBndBox[4]));
- float dX, dXmin=1.e20;
- for (int i=0; i<3; ++i) {
- dX=myBndBox[2*i+1]-myBndBox[2*i];
- if (dX<dXmin){
- dXmin=dX;
- }
- }
- pSphereWidget->SetRadius(dXmin);
+ VISU_PlanesWidget *aPlanesWidget = myWidgetCtrl->GetPlanesWidget();
+ aPlanesWidget->InitialPlaceWidget(myBndBox);
+ aPlanesWidget->SetOrigin(0.5*(myBndBox[1] + myBndBox[0]),
+ 0.5*(myBndBox[3] + myBndBox[2]),
+ 0.5*(myBndBox[5] + myBndBox[4]));
+ //
+ VISU_SphereWidget *aSphereWidget = myWidgetCtrl->GetSphereWidget();
+ aSphereWidget->SetCenter(0.5*(myBndBox[1] + myBndBox[0]),
+ 0.5*(myBndBox[3] + myBndBox[2]),
+ 0.5*(myBndBox[5] + myBndBox[4]));
+
+ float aMinLength = VTK_LARGE_FLOAT;
+ for (int i=0; i<3; ++i) {
+ float aLength = myBndBox[2*i+1]-myBndBox[2*i];
+ aMinLength = std::min(aMinLength,aLength);
}
+ aSphereWidget->SetRadius(aMinLength);
}
+
//----------------------------------------------------------------------------
void
VVTK_Renderer1
}
//----------------------------------------------------------------------------
-VISU_WidgetCtrl* VVTK_Renderer1::GetWidgetCtrl()
+VISU_WidgetCtrl*
+VVTK_Renderer1
+::GetWidgetCtrl()
{
return myWidgetCtrl.GetPointer();
}
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VVTK_SegmentationCursorDlg.cxx
// Author : Oleg Uvarov
#include "VISU_GaussPointsPL.hxx"
#include "VISU_OpenGLPointSpriteMapper.hxx"
+#include "LightApp_Application.h"
#include "SUIT_MessageBox.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_Session.h"
static TTextureMap aTextureMap;
TTextureValue aTextureValue;
- TTextureKey aTextureKey(theMainTexture,theAlphaTexture);
+ TTextureKey aTextureKey(theMainTexture.latin1(),theAlphaTexture.latin1());
TTextureMap::const_iterator anIter = aTextureMap.find(aTextureKey);
if(anIter != aTextureMap.end()){
aTextureValue = anIter->second;
myEventCallbackCommand.GetPointer(),
myPriority);
- SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
setCaption( tr( "SEGMENTATION_CURSOR_DLG_TITLE" ) );
setSizeGripEnabled(TRUE);
QLabel* ZOriginLabel = new QLabel( tr( "ORIGIN_Z" ), myOriginGroup );
myZOriginSpinBox = new QtxDblSpinBox( -1000.0, 1000.0, 0.1, myOriginGroup );
- myZOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ //myZOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myZOriginSpinBox->setMinimumWidth( 100 );
- myZOriginSpinBox->setValue( 0.0 );
+ myZOriginSpinBox->setValue( 1.0 );
OriginGroupLayout->addWidget( XOriginLabel, 0, 0 );
OriginGroupLayout->addWidget( myXOriginSpinBox, 0, 1 );
buttonClose->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonClose, 0, 2 );
+ QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" );
+ buttonHelp->setAutoDefault( TRUE );
+ GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
+
TopLayout->addWidget( myTabBox );
TopLayout->addWidget( GroupButtons );
connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onClickApply() ) );
connect( buttonClose, SIGNAL( clicked() ), this, SLOT( onClickClose() ) );
+ connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onClickHelp() ) );
+
+ connect(parent, SIGNAL(Show( QShowEvent * )), this, SLOT(onParentShow()));
+ connect(parent, SIGNAL(Hide( QHideEvent * )), this, SLOT(onParentHide()));
}
VVTK_SegmentationCursorDlg::~VVTK_SegmentationCursorDlg()
myRadiusGroup->hide();
VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget();
- float origin[3];
+ vtkFloatingPointType origin[3];
pPlanesWidget->GetOrigin( origin );
myXOriginSpinBox->setValue( origin[0] );
myYOriginSpinBox->setValue( origin[1] );
myZOriginSpinBox->setValue( origin[2] );
- float normal[3];
+ vtkFloatingPointType normal[3];
pPlanesWidget->GetNormal( normal );
myDXDirectionSpinBox->setValue( normal[0] );
myDYDirectionSpinBox->setValue( normal[1] );
myRadiusGroup->show();
VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget();
- float origin[3], aRadius;
+ vtkFloatingPointType origin[3], aRadius;
pSphereWidget->GetCenter(origin);
myXOriginSpinBox->setValue( origin[0] );
myYOriginSpinBox->setValue( origin[1] );
void VVTK_SegmentationCursorDlg::UpdateInsideGaussPoints()
{
int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
- float aClamp = 200.0;
+ vtkFloatingPointType aClamp = 200.0;
QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp";
QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp";
- float anAlphaThreshold = 0.1;
+ vtkFloatingPointType anAlphaThreshold = 0.1;
int aResolution = 8;
int aMinSize = 3;
int aMaxSize = 33;
int aMagnification = 100;
- float anIncrement = 2.0;
+ vtkFloatingPointType anIncrement = 2.0;
if( !myInsideCursorSettings->GetInitial() )
{
void VVTK_SegmentationCursorDlg::UpdateOutsideGaussPoints()
{
- float aClamp = 256.0;
+ vtkFloatingPointType aClamp = 256.0;
int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp";
QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp";
- float anAlphaThreshold = 0.1;
+ vtkFloatingPointType anAlphaThreshold = 0.1;
int aResolution = 8;
int aSize = 25;
bool aUniform = false;
myOutsideSizeBox->setOutsideSize( myOutsideCursorSettings->GetSize() );
myOutsideSizeBox->setUniform( myOutsideCursorSettings->GetUniform() );
- float* aColor = myOutsideCursorSettings->GetColor();
+ vtkFloatingPointType* aColor = myOutsideCursorSettings->GetColor();
myOutsideSizeBox->setColor( QColor( ( int )( aColor[0] * 255.0 ),
( int )( aColor[1] * 255.0 ),
( int )( aColor[2] * 255.0 ) ) );
if( myIsPlaneSegmentation )
{
VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget();
- float origin[3];
+ vtkFloatingPointType origin[3];
origin[0] = myXOriginSpinBox->value();
origin[1] = myYOriginSpinBox->value();
origin[2] = myZOriginSpinBox->value();
pPlanesWidget->SetOrigin( origin );
- float normal[3];
+ vtkFloatingPointType normal[3];
normal[0] = myDXDirectionSpinBox->value();
normal[1] = myDYDirectionSpinBox->value();
normal[2] = myDZDirectionSpinBox->value();
else
{
VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget();
- float origin[3], aRadius;
+ vtkFloatingPointType origin[3], aRadius;
origin[0] = myXOriginSpinBox->value();
origin[1] = myYOriginSpinBox->value();
origin[2] = myZOriginSpinBox->value();
myOutsideCursorSettings->SetUniform( myOutsideSizeBox->getUniform() );
QColor aButtonColor = myOutsideSizeBox->getColor();
- float aColor[3];
+ vtkFloatingPointType aColor[3];
aColor[0] = aButtonColor.red() / 255.0;
aColor[1] = aButtonColor.green() / 255.0;
aColor[2] = aButtonColor.blue() / 255.0;
reject();
}
+void VVTK_SegmentationCursorDlg::onClickHelp()
+{
+ QString aHelpFileName = "segmentation.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
+
void VVTK_SegmentationCursorDlg::done( int r )
{
myPlaneAction->setOn( false );
QDialog::done( r );
}
+void VVTK_SegmentationCursorDlg::onParentShow()
+{
+ if(myPlaneAction->isOn() || mySphereAction->isOn())
+ show();
+ else
+ hide();
+}
+
+void VVTK_SegmentationCursorDlg::onParentHide()
+{
+ hide();
+}
+
bool VVTK_SegmentationCursorDlg::CheckNumberOfFaces()
{
if( !myInteractor )
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : VVTK_SegmentationCursorDlg.h
// Author : Oleg Uvarov
protected slots:
virtual void done( int );
+ void onParentShow();
+ void onParentHide();
void onClickApply();
void onClickClose();
+ void onClickHelp();
signals:
void scgClose();
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
VVTK_SizeBox::VVTK_SizeBox( QWidget* parent ) :
QVBox( parent )
{
- SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
layout()->setSpacing( 0 );
layout()->setMargin( 0 );
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#include "VVTK_ViewManager.h"
#include "VVTK_ViewModel.h"
VVTK_ViewManager
::VVTK_ViewManager( SUIT_Study* study,
SUIT_Desktop* theDesktop )
-: SUIT_ViewManager( study, theDesktop )
+: SVTK_ViewManager( study, theDesktop )
{
myId = ++_VVTKViewMgr_Id;
setViewModel( new VVTK_Viewer() );
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#ifndef VVTK_VIEWMANAGER_H
#define VVTK_VIEWMANAGER_H
-#include "SUIT_ViewManager.h"
+#include "SVTK_ViewManager.h"
#include "VVTK.h"
class SUIT_Desktop;
//! Extend SUIT_ViewManager to deal with VVTK_Viewer
-class VVTK_EXPORT VVTK_ViewManager : public SUIT_ViewManager
+class VVTK_EXPORT VVTK_ViewManager : public SVTK_ViewManager
{
Q_OBJECT;
public:
-#include <qpopupmenu.h>
-#include <qcolordialog.h>
-
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#include "VVTK_ViewModel.h"
-#include "VVTK_ViewWindow.h"
-
-#include "SVTK_View.h"
-#include "SVTK_MainWindow.h"
-#include "SVTK_RenderWindowInteractor.h"
-#include "VTKViewer_ViewModel.h"
+#include "VVTK_ViewWindow.h"
-//==========================================================
-VVTK_Viewer
-::VVTK_Viewer()
+VVTK_Viewer::
+VVTK_Viewer()
{
- myTrihedronSize = 105;
}
-VVTK_Viewer
-::~VVTK_Viewer()
-{}
-
-
-//==========================================================
-void
-VVTK_Viewer
-::setViewManager(SUIT_ViewManager* theViewManager)
+VVTK_Viewer::
+~VVTK_Viewer()
{
- SUIT_ViewModel::setViewManager(theViewManager);
-
- if ( !theViewManager )
- return;
-
- connect(theViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
- this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
-
- connect(theViewManager, SIGNAL(mouseMove(SUIT_ViewWindow*, QMouseEvent*)),
- this, SLOT(onMouseMove(SUIT_ViewWindow*, QMouseEvent*)));
-
- connect(theViewManager, SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)),
- this, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));
}
-
//==========================================================
-SUIT_ViewWindow*
-VVTK_Viewer
-::createView( SUIT_Desktop* theDesktop )
+SUIT_ViewWindow*
+VVTK_Viewer::
+createView( SUIT_Desktop* theDesktop )
{
- TViewWindow* aViewWindow = new TViewWindow(theDesktop);
+ TViewWindow* aViewWindow = new TViewWindow (theDesktop);
aViewWindow->Initialize(this);
-
+
aViewWindow->setBackgroundColor( backgroundColor() );
aViewWindow->SetTrihedronSize( trihedronSize() );
return aViewWindow;
}
-
-
-//==========================================================
-void
-VVTK_Viewer
-::contextMenuPopup( QPopupMenu* thePopup )
-{
- thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
- thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
-
- thePopup->insertSeparator();
-
- if(TViewWindow* aView = dynamic_cast<TViewWindow*>(myViewManager->getActiveView())){
- if ( !aView->getMainWindow()->getToolBar()->isVisible() ){
- thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
- }
- }
-}
-
-
-//==========================================================
-void
-VVTK_Viewer
-::Repaint()
-{
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
- if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at(i))){
- aView->getMainWindow()->Repaint();
- }
- }
-}
-
-
-//==========================================================
-bool
-VVTK_Viewer
-::isVisible( const Handle(SALOME_InteractiveObject)& io )
-{
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
- if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
- if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow))
- if(!aView->getView()->isVisible( io ))
- return false;
-
- return true;
-}
-
-
-//==========================================================
-void
-VVTK_Viewer
-::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event)
-{}
-
-void
-VVTK_Viewer
-::onMouseMove(SUIT_ViewWindow* vw, QMouseEvent* event)
-{}
-
-void
-VVTK_Viewer
-::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event)
-{}
-
-
-//==========================================================
-QColor
-VVTK_Viewer
-::backgroundColor() const
-{
- return myBgColor;
-}
-
-void
-VVTK_Viewer
-::setBackgroundColor( const QColor& theColor )
-{
- if ( !theColor.isValid() )
- return;
-
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
- if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){
- if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow)){
- aView->setBackgroundColor(theColor);
- }
- }
- }
-
- myBgColor = theColor;
-}
-
-//==========================================================
-int
-VVTK_Viewer
-::trihedronSize() const
-{
- return myTrihedronSize;
-}
-
-void
-VVTK_Viewer
-::setTrihedronSize( const int theSize )
-{
- myTrihedronSize = theSize;
- if(SUIT_ViewManager* aViewManager = getViewManager()){
- QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
- for ( int i = 0; i < aViews.count(); i++ ){
- if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i ))){
- aView->getMainWindow()->SetTrihedronSize( theSize );
- }
- }
- }
-}
-
-//==========================================================
-void
-VVTK_Viewer
-::onDumpView()
-{
- if(SUIT_ViewWindow* aView = myViewManager->getActiveView())
- aView->onDumpView();
-}
-
-//==========================================================
-void
-VVTK_Viewer
-::onChangeBgColor()
-{
- if(SUIT_ViewWindow* aView = myViewManager->getActiveView()){
- QColor aColor = QColorDialog::getColor( backgroundColor(), aView);
- setBackgroundColor(aColor);
- }
-}
-
-//==========================================================
-void
-VVTK_Viewer
-::onShowToolbar()
-{
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
- if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at(i))){
- aView->getMainWindow()->getToolBar()->show();
- }
- }
-}
-
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#ifndef VVTK_VIEWMODEL_H
#define VVTK_VIEWMODEL_H
#include <qcolor.h>
#include "VVTK.h"
-#include "SVTK_ViewModelBase.h"
-
-#include "SALOME_Prs.h"
-#include "SALOME_InteractiveObject.hxx"
+#include "SVTK_ViewModel.h"
class VVTK_ViewWindow;
-//! Extends two interfaces #SVTK_ViewModelBase and #SALOME_View
-class VVTK_EXPORT VVTK_Viewer : public SVTK_ViewModelBase, public SALOME_View
+//! VVTK View Model
+class VVTK_EXPORT VVTK_Viewer : public SVTK_Viewer
{
Q_OBJECT;
VVTK_Viewer();
virtual ~VVTK_Viewer();
- //! Redefine SUIT_ViewModel::createView
+ //! See #SUIT_ViewModel::createView
virtual SUIT_ViewWindow* createView(SUIT_Desktop*);
- //! Redefine SUIT_ViewModel::setViewManager
- virtual void setViewManager(SUIT_ViewManager* theViewManager);
- //! Redefine SUIT_ViewModel::contextMenuPopup
- virtual void contextMenuPopup( QPopupMenu* );
//! See SUIT_ViewModel::getType
virtual QString getType() const { return Type(); }
-
- //! Redefine SALOME_View::Repaint
- virtual void Repaint();
-
- //! Redefine SALOME_View::isVisible
- virtual bool isVisible( const Handle(SALOME_InteractiveObject)& );
-
- //! Get background color of the viewer
- QColor backgroundColor() const;
-
- //! Set background color to the viewer
- void setBackgroundColor( const QColor& );
-
- //! Get size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize)
- int trihedronSize() const;
-
- //! Set size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize)
- void setTrihedronSize( const int );
-
-protected slots:
- void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
- void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
- void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
-
- void onDumpView();
- void onShowToolbar();
- void onChangeBgColor();
-
-private:
- QColor myBgColor;
- int myTrihedronSize;
- bool mySelectionEnabled;
- bool myMultiSelectionEnabled;
};
#endif
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
}
//----------------------------------------------------------------------------
-void
+bool
VVTK_ViewWindow
::action( const int accelAction )
{
- if(myMainWindow1->hasFocus())
- myMainWindow1->action(accelAction);
- if(myMainWindow2->hasFocus())
- myMainWindow2->action(accelAction);
+ if ( myMainWindow1->hasFocus() )
+ myMainWindow1->action( accelAction );
+ else if ( myMainWindow2->hasFocus() )
+ myMainWindow2->action( accelAction );
+ else
+ return false;
+ return true;
}
//----------------------------------------------------------------------------
VVTK_ViewWindow
::setBackgroundColor( const QColor& theColor )
{
- if( myMainWindow1->GetInteractor()->hasFocus() )
- myMainWindow1->SetBackgroundColor( theColor );
- else if( myMainWindow2->GetInteractor()->hasFocus() )
- myMainWindow2->SetBackgroundColor( theColor );
- else
- myMainWindow->SetBackgroundColor( theColor );
+ myMainWindow1->SetBackgroundColor( theColor );
+ myMainWindow2->SetBackgroundColor( theColor );
}
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#ifndef VVTK_VIEWWINDOW_H
#define VVTK_VIEWWINDOW_H
//----------------------------------------------------------------------------
protected:
virtual
- void
+ bool
action( const int );
virtual QImage dumpView();