#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "SALOME v.3.1.0a"
+PROJECT_NAME = "SALOME - VISU - v.3.1.0"
PROJECT_NUMBER = id#1.1
OUTPUT_DIRECTORY = ../
CREATE_SUBDIRS = NO
/*! Shrinks and enlarges the 2D plot to fit the 2D viewer.
*/
void FitAll();
+
+ /*! Set range of the 2D plot to X axis of the 2D viewer.
+ */
+ void FitXRange(in double xMin, in double xMax);
+
+ /*! Set range of the 2D plot to Y axis of the 2D viewer.
+ */
+ void FitYRange(in double yMin, in double yMax);
+
+ /*! Set range of the 2D plot to XY axis of the 2D viewer.
+ */
+ void FitRange(in double xMin, in double xMax,
+ in double yMin, in double yMax);
+
+ void GetFitRanges(out double xMin,out double xMax,
+ out double yMin,out double yMax);
};
//-------------------------------------------------------
anAppendPolyData->Delete();
//Calculate values for building of table
vtkMath::Cross(aDir[0],aDir[1],myDirLn);
+ for (int i=0; i<3 ; i++) if(myDirLn[i]<0) myDirLn[i] = (-1)*myDirLn[i];//enk:: correction of bug Bug PAL10401
GetBoundProject(myBoundPrjLn, aBaseBounds, myDirLn);
VISU::Mul(myDirLn,myBoundPrjLn[0],myBasePnt);
CorrectPnt(myBasePnt,aBaseBounds);
}
}
*/
+
void VisuGUI::createPreferences()
{
+ // TAB: "Scalar Bar"
int sbarTab = addPreference( tr( "VISU_SCALAR_BAR" ) );
int rangeGr = addPreference( tr( "VISU_SCALAR_RANGE" ), sbarTab );
setPreferenceProperty( min, "step", 0.1 );
setPreferenceProperty( max, "step", 0.1 );
+ // group: "Font"
int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab );
- int tfont = addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Font, "VISU", "scalar_bar_title_font" );
- addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_title_color" );
- int lfont = addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Font, "VISU", "scalar_bar_label_font" );
- addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_label_color" );
+ int tfont = addPreference( tr( "VISU_TITLE" ), fontGr,
+ LightApp_Preferences::Font, "VISU", "scalar_bar_title_font" );
+ addPreference( tr( "VISU_TITLE" ), fontGr,
+ LightApp_Preferences::Color, "VISU", "scalar_bar_title_color" );
+ int lfont = addPreference( tr( "VISU_LABELS" ), fontGr,
+ LightApp_Preferences::Font, "VISU", "scalar_bar_label_font" );
+ addPreference( tr( "VISU_LABELS" ), fontGr,
+ LightApp_Preferences::Color, "VISU", "scalar_bar_label_color" );
QStringList fam;
fam.append( tr( "VISU_FONT_ARIAL" ) );
fam.append( tr( "VISU_FONT_COURIER" ) );
fam.append( tr( "VISU_FONT_TIMES" ) );
- int wflag = ( QtxListResourceEdit::FontItem::All & ( ~( QtxListResourceEdit::FontItem::Size | QtxListResourceEdit::FontItem::UserSize ) ) );
+ int wflag = ( QtxListResourceEdit::FontItem::All &
+ ( ~( QtxListResourceEdit::FontItem::Size |
+ QtxListResourceEdit::FontItem::UserSize ) ) );
setPreferenceProperty( tfont, "families", fam );
setPreferenceProperty( tfont, "system", false );
setPreferenceProperty( lfont, "system", false );
setPreferenceProperty( lfont, "widget_flags", wflag );
+ // group: "Colors & Labels"
int colorsLabelsGr = addPreference( tr( "VISU_COLORS_AND_LABELS" ), sbarTab );
- int numcol = addPreference( tr( "VISU_NB_COLORS" ), colorsLabelsGr, LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_colors" );
+ int numcol = addPreference( tr( "VISU_NB_COLORS" ), colorsLabelsGr,
+ LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_colors" );
setPreferenceProperty( numcol, "min", 2 );
setPreferenceProperty( numcol, "max", 256 );
- int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr, LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" );
+ int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr,
+ LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" );
setPreferenceProperty( numlab, "min", 2 );
setPreferenceProperty( numlab, "max", 65 );
+ // group: "Orientation"
int orientGr = addPreference( tr( "VISU_ORIENTATION" ), sbarTab );
- int orient = addPreference( tr( "VISU_ORIENTATION" ), orientGr, LightApp_Preferences::Selector, "VISU", "scalar_bar_orientation" );
+ int orient = addPreference( tr( "VISU_ORIENTATION" ), orientGr,
+ LightApp_Preferences::Selector, "VISU", "scalar_bar_orientation" );
QStringList orients;
orients.append( tr( "VISU_VERTICAL" ) );
orients.append( tr( "VISU_HORIZONTAL" ) );
setPreferenceProperty( orient, "strings", orients );
setPreferenceProperty( orient, "indexes", indices );
+ // group: "Origin & Size Vertical"
int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ), sbarTab );
- int xv = addPreference( tr( "VISU_X" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
- int yv = addPreference( tr( "VISU_Y" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_y" );
- int wv = addPreference( tr( "VISU_WIDTH" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_width" );
- int hv = addPreference( tr( "VISU_HEIGHT" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_height" );
+ int xv = addPreference( tr( "VISU_X" ), posVSizeGr,
+ LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
+ int yv = addPreference( tr( "VISU_Y" ), posVSizeGr,
+ LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_y" );
+ int wv = addPreference( tr( "VISU_WIDTH" ), posVSizeGr,
+ LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_width" );
+ int hv = addPreference( tr( "VISU_HEIGHT" ), posVSizeGr,
+ LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_height" );
setPreferenceProperty( xv, "step", 0.1 );
setPreferenceProperty( yv, "step", 0.1 );
setPreferenceProperty( wv, "step", 0.1 );
setPreferenceProperty( wv, "max", 1.0 );
setPreferenceProperty( hv, "max", 1.0 );
+ // group: "Origin & Size Horizontal"
int posHSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_HORIZONTAL" ), sbarTab );
- int xh = addPreference( tr( "VISU_X" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_x" );
- int yh = addPreference( tr( "VISU_Y" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_y" );
- int wh = addPreference( tr( "VISU_WIDTH" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_width" );
- int hh = addPreference( tr( "VISU_HEIGHT" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_height" );
+ int xh = addPreference( tr( "VISU_X" ), posHSizeGr,
+ LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_x" );
+ int yh = addPreference( tr( "VISU_Y" ), posHSizeGr,
+ LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_y" );
+ int wh = addPreference( tr( "VISU_WIDTH" ), posHSizeGr,
+ LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_width" );
+ int hh = addPreference( tr( "VISU_HEIGHT" ), posHSizeGr,
+ LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_height" );
setPreferenceProperty( xh, "step", 0.1 );
setPreferenceProperty( yh, "step", 0.1 );
setPreferenceProperty( wh, "step", 0.1 );
setPreferenceProperty( wh, "max", 1.0 );
setPreferenceProperty( hh, "max", 1.0 );
+ // group: "Scalar bars default position"
int scalarBarGr = addPreference( tr( "Scalar bars default position" ), sbarTab );
addPreference( tr( "Arrange Scalar Bars" ), scalarBarGr, LightApp_Preferences::Bool, "VISU", "scalar_bars_default_position" );
int srangeTab = addPreference( tr( "Sweep, MED import" ) );
+ // group: "Sweeping preferences"
int sweepGr = addPreference( tr( "VISU_SWEEPING_PREF" ), srangeTab );
setPreferenceProperty( sweepGr, "columns", 1 );
- int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGr, LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
- int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGr, LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
- int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGr, LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
+ int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGr,
+ LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
+ int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGr,
+ LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
+ int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGr,
+ LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
setPreferenceProperty( timestep, "min", 0.1 );
setPreferenceProperty( timestep, "step", 0.1 );
setPreferenceProperty( timestep, "max", 1000 );
setPreferenceProperty( nbcycles, "max", 100 );
setPreferenceProperty( nbsteps, "max", 200 );
+ // group: "MED files import"
int importGr = addPreference( tr( "MED files import" ), srangeTab );
setPreferenceProperty( importGr, "columns", 1 );
addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" );
addPreference( tr( "Build min/max" ), importGr, LightApp_Preferences::Bool, "VISU", "build_min_max" );
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,
+ LightApp_Preferences::Bool, "VISU", "represent_shading" );
}
void VisuGUI::preferencesChanged( const QString&, const QString& )
aDist = fabs(aBounds[5] - aBounds[4]);
}
float aOffset[3];
- aOffset[0] = (aBounds[1] < aBounds[0]) ? -aBounds[1] : -aBounds[0];
- aOffset[1] = (aBounds[3] < aBounds[2]) ? -aBounds[3] : -aBounds[2];
- aOffset[2] = (aBounds[5] < aBounds[4]) ? -aBounds[5] : -aBounds[4];
+ 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;
aSaveLay->addWidget(aPathLbl, 1, 0);
myPathEdit = new QLineEdit(aSaveBox);
+ myPathEdit->setReadOnly(true);
myPathEdit->setEnabled(false);
connect(mySaveCheck, SIGNAL( toggled(bool)),
myPathEdit, SLOT( setEnabled(bool) ));
//------------------------------------------------------------------------
void VisuGUI_TimeAnimationDlg::onBrowse()
{
- QString aPath = SUIT_FileDlg::getExistingDirectory(this, "/","Select path");
+ QString aPath = SUIT_FileDlg::getExistingDirectory(this, "/", "Select path");
if (!aPath.isEmpty())
- myPathEdit->setText(aPath);
+ myPathEdit->setText(Qtx::addSlash(aPath));
}
//------------------------------------------------------------------------
void
VISU::ColoredPrs3d_i
-::SameAs(const ColoredPrs3d_i* theOrigin)
+::SameAs(const Prs3d_i* theOrigin)
{
- DoHook();
+ if(const ColoredPrs3d_i* aPrs3d = dynamic_cast<const ColoredPrs3d_i*>(theOrigin)){
+ DoHook();
- ColoredPrs3d_i* anOrigin = const_cast<ColoredPrs3d_i*>(theOrigin);
+ ColoredPrs3d_i* anOrigin = const_cast<ColoredPrs3d_i*>(aPrs3d);
- myField = anOrigin->GetField();
- myMeshName = myField->myMeshName;
- myEntity = myField->myEntity;
- myIteration = anOrigin->GetIteration();
- myFieldName = anOrigin->GetFieldName();
-
- Build(-1);
-
- TSuperClass::SameAs(theOrigin);
-
- SetScalarMode(anOrigin->GetScalarMode());
- SetNbColors(anOrigin->GetNbColors());
- SetBarOrientation(anOrigin->GetBarOrientation());
-
- SetPosition(anOrigin->GetPosX(), anOrigin->GetPosY());
- SetSize(anOrigin->GetWidth(), anOrigin->GetHeight());
- SetLabels(anOrigin->GetLabels());
- SetTitle(anOrigin->GetTitle());
-
- SetBoldTitle(anOrigin->IsBoldTitle());
- SetItalicTitle(anOrigin->IsItalicTitle());
- SetShadowTitle(anOrigin->IsShadowTitle());
- SetTitFontType(anOrigin->GetTitFontType());
- float r,g,b;
- anOrigin->GetTitleColor(&r,&g,&b);
- SetTitleColor(r,g,b);
-
- SetBoldLabel(anOrigin->IsBoldLabel());
- SetItalicLabel(anOrigin->IsItalicLabel());
- SetShadowLabel(anOrigin->IsShadowLabel());
- SetLblFontType(anOrigin->GetLblFontType());
- anOrigin->GetLabelColor(&r,&g,&b);
- SetLabelColor(r,g,b);
+ myField = anOrigin->GetField();
+ myMeshName = myField->myMeshName;
+ myEntity = myField->myEntity;
+ myIteration = anOrigin->GetIteration();
+ myFieldName = anOrigin->GetFieldName();
+
+ Build(-1);
+
+ TSuperClass::SameAs(theOrigin);
+
+ SetScalarMode(anOrigin->GetScalarMode());
+ SetNbColors(anOrigin->GetNbColors());
+ SetBarOrientation(anOrigin->GetBarOrientation());
+
+ SetPosition(anOrigin->GetPosX(), anOrigin->GetPosY());
+ SetSize(anOrigin->GetWidth(), anOrigin->GetHeight());
+ SetLabels(anOrigin->GetLabels());
+ SetTitle(anOrigin->GetTitle());
+
+ SetBoldTitle(anOrigin->IsBoldTitle());
+ SetItalicTitle(anOrigin->IsItalicTitle());
+ SetShadowTitle(anOrigin->IsShadowTitle());
+ SetTitFontType(anOrigin->GetTitFontType());
+ float r,g,b;
+ anOrigin->GetTitleColor(&r,&g,&b);
+ SetTitleColor(r,g,b);
+
+ SetBoldLabel(anOrigin->IsBoldLabel());
+ SetItalicLabel(anOrigin->IsItalicLabel());
+ SetShadowLabel(anOrigin->IsShadowLabel());
+ SetLblFontType(anOrigin->GetLblFontType());
+ anOrigin->GetLabelColor(&r,&g,&b);
+ SetLabelColor(r,g,b);
+ }
}
-
+
void
VISU::ColoredPrs3d_i
::SameAsParams(const ColoredPrs3d_i* theOrigin)
virtual
void
- SameAs(const ColoredPrs3d_i* theOrigin);
+ SameAs(const Prs3d_i* theOrigin);
/*!
* \brief Works like SameAs() method, but keep myIteration value unchanged.
}
-void VISU::CutLines_i::SameAs(const CutLines_i* theOrigin){
- VISU::ScalarMap_i::SameAs(theOrigin);
-}
-
/*! Copy map to /a myMapCurvesInverted.
* \param theCurves - map
*/
explicit
CutLines_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual void SameAs(const CutLines_i* theOrigin);
virtual ~CutLines_i();
virtual VISU::VISUType GetType() { return VISU::TCUTLINES;};
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
myCutPlanesPL(NULL)
-{}
-
-
-void VISU::CutPlanes_i::SameAs(const CutPlanes_i* theOrigin){
- VISU::ScalarMap_i::SameAs(theOrigin);
+{
}
explicit
CutPlanes_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual void SameAs(const CutPlanes_i* theOrigin);
virtual ~CutPlanes_i();
virtual VISU::VISUType GetType() { return VISU::TCUTPLANES;};
}
-void VISU::DeformedShape_i::SameAs(const DeformedShape_i* theOrigin)
+void VISU::DeformedShape_i::SameAs(const Prs3d_i* theOrigin)
{
- DeformedShape_i* aDefShape = const_cast<DeformedShape_i*>(theOrigin);
- VISU::ScalarMap_i::SameAs(theOrigin);
+ TSuperClass::SameAs(theOrigin);
- SetColor(aDefShape->GetColor());
- ShowColored(aDefShape->IsColored());
+ if(const DeformedShape_i* aPrs3d = dynamic_cast<const DeformedShape_i*>(theOrigin)){
+ DeformedShape_i* anOrigin = const_cast<DeformedShape_i*>(aPrs3d);
+ SetColor(anOrigin->GetColor());
+ ShowColored(anOrigin->IsColored());
+ }
}
explicit
DeformedShape_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual void SameAs(const DeformedShape_i* theOrigin);
+ virtual void SameAs(const Prs3d_i* theOrigin);
virtual ~DeformedShape_i();
virtual VISU::VISUType GetType() { return VISU::TDEFORMEDSHAPE;};
Mutex mt(myMutex);
SALOMEDS::Study_var aStudy = theComponent->GetStudy();
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
- const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str();
- TCollection_AsciiString aTmpDir(const_cast<char*>(aDir));
+ string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
+ TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
VisuTmpDir = aTmpDir.ToCString();
SALOMEDS::ListOfFileNames_var aSeq =
SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.ToCString(),isMultiFile);
bool isMultiFile)
{
Mutex mt(myMutex);
- const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str();
- TCollection_AsciiString aTmpDir(const_cast<char*>(aDir));
+ string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
+ TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
int aCounter = 0;
TColStd_SequenceOfAsciiString aFileNames;
bool isMultiFile)
{
Mutex mt(myMutex);
- const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str();
- TCollection_AsciiString aTmpDir(const_cast<char*>(aDir));
+ string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
+ TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
int aCounter = 0;
TColStd_SequenceOfAsciiString aFileNames;
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
myIsoSurfacesPL(NULL)
-{}
-
-
-void VISU::IsoSurfaces_i::SameAs(const IsoSurfaces_i* theOrigin) {
- VISU::ScalarMap_i::SameAs(theOrigin);
+{
}
explicit
IsoSurfaces_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual void SameAs(const IsoSurfaces_i* theOrigin);
virtual ~IsoSurfaces_i();
virtual VISU::VISUType GetType() { return VISU::TISOSURFACE;};
}
-void VISU::Mesh_i::SameAs (const Mesh_i* theOrigin)
+void VISU::Mesh_i::SameAs (const Prs3d_i* theOrigin)
{
return; // "SameAs" command for mesh is not valid in current architecture
}
explicit
Mesh_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual void SameAs(const Mesh_i* theOrigin);
+ virtual void SameAs(const Prs3d_i* theOrigin);
virtual ~Mesh_i();
virtual void RemoveFromStudy();
+// 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/
+//
#include "VISU_Plot3D_i.hh"
myPlot3DPL(NULL)
{}
-void VISU::Plot3D_i::SameAs (const Plot3D_i* theOrigin)
-{
- VISU::ScalarMap_i::SameAs(theOrigin);
-}
-
VISU::Storable* VISU::Plot3D_i::Create (const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, int theIteration)
{
+// 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/
+//
#ifndef VISU_Plot3D_i_HeaderFile
#define VISU_Plot3D_i_HeaderFile
explicit
Plot3D_i (Result_i* theResult, SALOMEDS::SObject_ptr theSObject);
- virtual void SameAs (const Plot3D_i* theOrigin);
virtual ~Plot3D_i();
virtual VISU::VISUType GetType() { return VISU::TPLOT3D; };
SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(aEngComp);
aStudyBuilder->LoadWith(aCompRefSObj, aDriver);
if (strcmp(aDataType, "MED") == 0){
- myInput = CreateMEDConvertor(aTargetRefSObj);
+ // create field or MED converter
+ CORBA::Object_var aMedObject = VISU::SObjectToObject(aTargetRefSObj);
+ SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(aMedObject);
+ if(!CORBA::is_nil(aField))
+ myInput = CreateMEDFieldConvertor(aField);
+ else
+ myInput = CreateMEDConvertor(aTargetRefSObj);
myInput->Build();
}else
throw std::runtime_error("GetInput - There is no convertor for the aDataType !!!");
//----------------------------------------------------------------------------
void
VISU::ScalarMap_i
-::SameAs(const ScalarMap_i* theOrigin)
+::SameAs(const Prs3d_i* theOrigin)
{
TSuperClass::SameAs(theOrigin);
- ScalarMap_i* anOrigin = const_cast<ScalarMap_i*>(theOrigin);
+ if(const ScalarMap_i* aPrs3d = dynamic_cast<const ScalarMap_i*>(theOrigin)){
+ ScalarMap_i* anOrigin = const_cast<ScalarMap_i*>(aPrs3d);
- SetRange(anOrigin->GetMin(), anOrigin->GetMax());
- myIsFixedRange = anOrigin->IsRangeFixed();
+ SetRange(anOrigin->GetMin(), anOrigin->GetMax());
+ myIsFixedRange = anOrigin->IsRangeFixed();
- SetScaling(anOrigin->GetScaling());
-
- Update();
+ SetScaling(anOrigin->GetScaling());
+
+ Update();
+ }
}
TSuperClass::CreateActor(anActor,theIO);
anActor->SetBarVisibility(true);
anActor->SetRepresentation(2);
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ bool toUseShading = aResourceMgr->booleanValue("VISU", "represent_shading", false);
+ anActor->SetShading(toUseShading);
UpdateActor(anActor);
}catch(...){
anActor->Delete();
virtual
void
- SameAs(const ScalarMap_i* theOrigin);
+ SameAs(const Prs3d_i* theOrigin);
virtual
VISU_Actor*
}
-void VISU::StreamLines_i::SameAs(const StreamLines_i* theOrigin) {
- StreamLines_i* aStreamLines = const_cast<StreamLines_i*>(theOrigin);
- VISU::DeformedShape_i::SameAs(theOrigin);
- SetSource(aStreamLines->GetSource());
+void VISU::StreamLines_i::SameAs(const Prs3d_i* theOrigin)
+{
+ TSuperClass::SameAs(theOrigin);
+
+ if(const StreamLines_i* aPrs3d = dynamic_cast<const StreamLines_i*>(theOrigin)) {
+ StreamLines_i* anOrigin = const_cast<StreamLines_i*>(aPrs3d);
+ SetSource(anOrigin->GetSource());
+ }
}
explicit
StreamLines_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual void SameAs(const StreamLines_i* theOriginal);
+ virtual void SameAs(const Prs3d_i* theOriginal);
virtual ~StreamLines_i();
virtual VISU::VISUType GetType() { return VISU::TSTREAMLINES;}
VISU::View3D_i* pView = dynamic_cast<VISU::View3D_i*>(GetServant(theView3D).in());
SUIT_ViewWindow* aVW = pView->GetViewWindow();
myView = VISU::GetViewWindow(aVW);
+ connect( myView, SIGNAL( destroyed() ), this, SLOT( onViewDeleted() ) );
}
myMaxVal = 0;
}
myView->Repaint(false);
- int delay = 100;
if (isDumping) {
+ // We must unlock mutex for some time before grabbing to allow view updating
+ qApp->unlock();
+ msleep(100);
+ qApp->lock();
+
QPixmap px = QPixmap::grabWindow(myView->winId());
QString aFile(myDumpPath);
QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
myFieldsLst[0].myTiming[myFrame]) / aOneVal;
}
}
- delay = (int)(1000. * k / mySpeed);
+ int delay = (int)(1000. * k / mySpeed);
+ qApp->unlock();
+ msleep(delay);
+ qApp->lock();
}
- qApp->unlock();
- msleep(delay);
- qApp->lock();
if (!myIsActive) break;
myAnimEntry = aStr.c_str();
}
+void VISU_TimeAnimation::onViewDeleted()
+{
+ myView = 0;
+}
+
//========================================================================
//========================================================================
void run();
QString GenerateName();
+ private slots:
+ void onViewDeleted();
+
private:
QString myLastError;
}
-void VISU::Vectors_i::SameAs(const VISU::Vectors_i* theOrigin) {
- Vectors_i* aVectors = const_cast<Vectors_i*>(theOrigin);
- VISU::DeformedShape_i::SameAs(theOrigin);
+void VISU::Vectors_i::SameAs(const VISU::Prs3d_i* theOrigin)
+{
+ TSuperClass::SameAs(theOrigin);
- SetLineWidth(aVectors->GetLineWidth());
+ if(const Vectors_i* aPrs3d = dynamic_cast<const Vectors_i*>(theOrigin)){
+ Vectors_i* anOrigin = const_cast<Vectors_i*>(aPrs3d);
+ SetLineWidth(anOrigin->GetLineWidth());
+ }
}
explicit
Vectors_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual void SameAs(const Vectors_i* theOrigin);
+ virtual void SameAs(const Prs3d_i* theOrigin);
virtual ~Vectors_i();
virtual VISU::VISUType GetType() { return VISU::TVECTORS;};
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
+#include <qapplication.h>
+
using namespace std;
#ifdef _DEBUG_
//if (CheckStudy(myStudyDocument)) {
if (myApplication) {
TViewFrame* pView = new TViewFrame (myApplication);
- if (pView->Create(1))
+ if (pView->Create(1)) {
myResult = pView->_this();
+ qApp->processEvents(); // Fix for bug 9929
+ }
}
}
};
# Libraries targets
-LIB = libVISU_Swigcmodule.la
+LIB = libVISU_Swigcmodule.la
LIB_SRC = VISU_Gen_s.cc
-SWIG_FLAGS +=
+SWIG_FLAGS +=
SWIG_DEF = libVISU_Swig.i
EXPORT_PYSCRIPTS = libVISU_Swig.py batchmode_visu.py batchmode_visu_table.py batchmode_visu_view3d.py \
- visu_med.py visu_view3d.py visu.py visu_gui.py visu_prs_example.py\
- visu_table.py visu_big_table.py visu_view.py visu_delete.py\
- visu_swig_test.py test_events.py batch_test_events.py
+ visu_med.py visu_view3d.py visu.py visu_gui.py visu_prs_example.py \
+ visu_table.py visu_big_table.py visu_view.py visu_delete.py \
+ visu_swig_test.py 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
EXPORT_SHAREDPYSCRIPTS = VISU_shared_modules.py
-LIB_CLIENT_IDL =
+LIB_CLIENT_IDL =
CPPFLAGS += -ftemplate-depth-32 $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(QT_INCLUDES) \
$(VTK_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome \
LDFLAGS += $(PYTHON_LIBS) -lVisuConvertor -lVisuPipeLine
@CONCLUDE@
-
\ No newline at end of file