-This is the version 2.0.0 of VISU
+This is the version 2.1.0 of VISU
Compatible with :
- - KERNEL 2.0.0
- - MED 2.0.0
+ - KERNEL 2.1.0
+ - MED 2.1.0
# MED_ROOT_DIR environment variable defined
MED_DIR=$MED_ROOT_DIR
- else
-
- # search Med binaries in PATH variable
- AC_PATH_PROG(TEMP, libMEDMEM_Swig.py)
- if test "x$TEMP" != "x" ; then
- MED_BIN_DIR=`dirname $TEMP`
- MED_DIR=`dirname $MED_BIN_DIR`
- fi
-
fi
#
fi
-if test -f ${MED_DIR}/bin/salome/libMEDMEM_Swig.py ; then
+if test -f ${MED_DIR}/idl/salome/MED.idl ; then
Med_ok=yes
AC_MSG_RESULT(Using Med module distribution in ${MED_DIR})
-THIS IS SALOME - VISU VERSION: 2.0.0
+THIS IS SALOME - VISU VERSION: 2.1.0
<td width="50%" bgcolor= "lightgreen" ><font size="+2"><div align="center"><b><i>IDL file</i></b></div></font></td>
<td width="50%" bgcolor= "lightgreen"><font size="+2"><div align="center"><b><i>Python</i></b></div></font></td>
</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void Destroy ( )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>Destroy ( )</b></div></td>
-</tr>
</table><br>
<table width="100%" BORDER>
<tr bgcolor="#FFFFCC">
<td width="50%" bgcolor= "lightgreen"><font size="+2"><div align="center"><b><i>Python</i></b></div></font></td>
</tr>
<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetScalarMode ( in long theScaling )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetScalarMode ( theScaling )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetScalarMode ( in long theScalarMode )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetScalarMode ( theScalarMode )</b></div></td>
</tr>
<tr>
<td bgcolor= "lightgreen"><div align="center"><b>long GetScalarMode ( )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetMax ( )</b></div></td>
</tr>
<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetOrientation ( in Orientation theOrientation )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetOrientation ( theOrientation )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetBarOrientation ( in Orientation theOrientation )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetBarOrientation ( theOrientation )</b></div></td>
</tr>
<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>Orientation GetOrientation ( )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetOrientation ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>Orientation GetBarOrientation ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetBarOrientation ( )</b></div></td>
</tr>
<tr>
<td bgcolor= "lightgreen"><div align="center"><b>void SetPosition ( in double X, in double Y )</b></div></td>
<td width="50%" bgcolor= "lightgreen"><font size="+2"><div align="center"><b><i>Python</i></b></div></font></td>
</tr>
<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetOrientationType ( in Orientation theNb )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetOrientationType ( theNb )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetOrientation ( in Orientation theOrientation, in double theXAngle, in double theYAngle )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetOrientation ( theOrientation, theXAngle, theYAngle )</b></div></td>
</tr>
<tr>
<td bgcolor= "lightgreen"><div align="center"><b>Orientation GetOrientationType ( )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetOrientationType ( )</b></div></td>
</tr>
<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>double GetRotateX ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateX ( )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>double GetRotateY ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateY ( )</b></div></td>
+</tr>
+<tr>
<td bgcolor= "lightgreen"><div align="center"><b>void SetDisplacement ( in double theDisp )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>SetDisplacement ( theDisp )</b></div></td>
</tr>
<td bgcolor= "lightgreen"><div align="center"><b>long GetNbPlanes ( )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetNbPlanes ( )</b></div></td>
</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetRotateX ( in double theAngle )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetRotateX ( theAngle )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double GetRotateX ( )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateX ( )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetRotateY ( in double theAngle )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetRotateY ( theAngle )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double GetRotateY ( )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateY ( )</b></div></td>
-</tr>
</table><br>
<table width="100%" BORDER>
<tr bgcolor="#FFFFCC">
<td width="50%" bgcolor= "lightgreen"><font size="+2"><div align="center"><b><i>Python</i></b></div></font></td>
</tr>
<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetOrientationType ( in Orientation theNb )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetOrientationType ( theNb )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetOrientation ( in Orientation theOrientation, in double theXAngle, in double theYAngle )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetOrientation ( theOrientation, theXAngle, theYAngle )</b></div></td>
</tr>
<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetOrientationType2 ( in Orientation theNb )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetOrientationType2 ( theNb )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetOrientation2 ( in Orientation theOrientation, in double theXAngle, in double theYAngle )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetOrientation2 ( theOrientation, theXAngle, theYAngle )</b></div></td>
</tr>
<tr>
<td bgcolor= "lightgreen"><div align="center"><b>Orientation GetOrientationType ( )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetOrientationType2 ( )</b></div></td>
</tr>
<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>double GetRotateX ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateX ( )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>double GetRotateX2 ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateX2 ( )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>double GetRotateY ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateY ( )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>double GetRotateY2 ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateY2 ( )</b></div></td>
+</tr>
+<tr>
<td bgcolor= "lightgreen"><div align="center"><b>void SetDisplacement ( in double theDisp )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>SetDisplacement ( theDisp )</b></div></td>
</tr>
<td bgcolor= "lightgreen"><div align="center"><b>long GetNbLines ( )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetNbLines ( )</b></div></td>
</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetRotateX ( in double theAngle )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetRotateX ( theAngle )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetRotateX2 ( in double theAngle )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetRotateX2 ( theAngle )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double GetRotateX ( )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateX ( )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double GetRotateX2 ( )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateX2 ( )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetRotateY ( in double theAngle )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetRotateY ( theAngle )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetRotateY2 ( in double theAngle )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetRotateY2 ( theAngle )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double GetRotateY ( )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateY ( )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double GetRotateY2 ( )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateY2 ( )</b></div></td>
-</tr>
</table><br>
<table width="100%" BORDER>
<tr bgcolor="#FFFFCC">
<td width="50%" bgcolor= "lightgreen"><font size="+2"><div align="center"><b><i>Python</i></b></div></font></td>
</tr>
<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetDirection ( in Direction theDirection )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetDirection ( theDirection )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>Direction GetDirection ( )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetDirection ( )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetStepLength ( in double theStep )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetStepLength ( theStep )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double GetStepLength ( )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetStepLength ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>boolean SetParams ( in double theIntStep, in double thePropogationTime, in double theStepLength, in Prs3d thePrs3d, in double thePercents, in Direction theDirection )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = SetParams ( theIntStep, thePropogationTime, theStepLength, thePrs3d, thePercents, theDirection )</b></div></td>
</tr>
<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetPropagationTime ( in double theTime )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetPropagationTime ( theTime )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>double GetIntegrationStep ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetIntegrationStep ( )</b></div></td>
</tr>
<tr>
<td bgcolor= "lightgreen"><div align="center"><b>double GetPropagationTime ( )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetPropagationTime ( )</b></div></td>
</tr>
<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetIntegrationStep ( in double theStep )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetIntegrationStep ( theStep )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double GetIntegrationStep ( )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetIntegrationStep ( )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetSource ( in Prs3d thePrs3d )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetSource ( thePrs3d )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>double GetStepLength ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetStepLength ( )</b></div></td>
</tr>
<tr>
<td bgcolor= "lightgreen"><div align="center"><b>Prs3d GetSource ( )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetSource ( )</b></div></td>
</tr>
<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetUsedPoints ( in double thePercents )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetUsedPoints ( thePercents )</b></div></td>
-</tr>
-<tr>
<td bgcolor= "lightgreen"><div align="center"><b>double GetUsedPoints ( )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetUsedPoints ( )</b></div></td>
</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>Direction GetDirection ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetDirection ( )</b></div></td>
+</tr>
</table><br>
<table width="100%" BORDER>
<tr bgcolor="#FFFFCC">
<td bgcolor= "lightgreen"><div align="center"><b>return_value = ImportTables ( theFileName )</b></div></td>
</tr>
<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>boolean ExportTableToFile ( in SObject theTable, in string theFileName )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = ExportTableToFile ( theTable, theFileName )</b></div></td>
+</tr>
+<tr>
<td bgcolor= "lightgreen"><div align="center"><b>Result ImportFile ( in string theFileName )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = ImportFile ( theFileName )</b></div></td>
</tr>
<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>Result CopyAndImportFile ( in string theFileName )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = CopyAndImportFile ( theFileName )</b></div></td>
+</tr>
+<tr>
<td bgcolor= "lightgreen"><div align="center"><b>Result ImportMed ( in SObject theMedSObject )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = ImportMed ( theMedSObject )</b></div></td>
</tr>
<td bgcolor= "lightgreen"><div align="center"><b>Animation CreateAnimation ( in View3D theView3d )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = CreateAnimation ( theView3d )</b></div></td>
</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void DeleteResult ( in Result theResult )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>DeleteResult ( theResult )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void DeletePrs3d ( in Prs3d thePrs3d )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>DeletePrs3d ( thePrs3d )</b></div></td>
+</tr>
</table><br>
<table width="100%" BORDER>
<tr bgcolor="#FFFFCC">
<td width="50%" bgcolor= "lightgreen"><font size="+2"><div align="center"><b><i>Python</i></b></div></font></td>
</tr>
<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void ShowPart ( in ViewRepresentation ViewRepr, in boolean state )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>ShowPart ( ViewRepr, state )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>boolean IsPartShown ( in ViewRepresentation ViewRepr )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = IsPartShown ( ViewRepr )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetViewWidth ( in long Width )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetViewWidth ( Width )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetViewHeight ( in long Height )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetViewHeight ( Height )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>long GetViewWidth ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetViewWidth ( )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>long GetViewHeight ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetViewHeight ( )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetViewPositionHorizontal ( in ViewPosition ViewPosHor )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetViewPositionHorizontal ( ViewPosHor )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetViewPositionVertical ( in ViewPosition ViewPosVer )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetViewPositionVertical ( ViewPosVer )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetRelativePosition ( in double x, in double y )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetRelativePosition ( x, y )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetRelativeSize ( in double x, in double y )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetRelativeSize ( x, y )</b></div></td>
+</tr>
+<tr>
<td bgcolor= "lightgreen"><div align="center"><b>void SetTitle ( in string theTitle )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>SetTitle ( theTitle )</b></div></td>
</tr>
<td bgcolor= "lightgreen"><div align="center"><b>void Destroy ( in View theView )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>Destroy ( theView )</b></div></td>
</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void ProcessEvents ( )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>ProcessEvents ( )</b></div></td>
-</tr>
</table><br>
</b></HTML>
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "SALOME - VISU - v.2.0.0"
+PROJECT_NAME = "SALOME - VISU - v.2.1.0"
PROJECT_NUMBER = id#1.1
OUTPUT_DIRECTORY = ../
OUTPUT_LANGUAGE = English
-foldersTree = gFld("<b>SALOME v.2.0.0 </b>", "", "")
+foldersTree = gFld("<b>SALOME v.2.1.0 </b>", "", "")
insDoc(foldersTree, gLnk("Main Page", "", "main.html"))
aux1 = insFld(foldersTree, gFld("TUI Reference Guide", ""))
provided by %ViewManager.
*/
interface VISU_Gen : Engines::Component, SALOMEDS::Driver, Base{
-/*! SAN & VSR : Test QT_EVENT
->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-*/
- void CreateTestView();
- void ShowTestObject();
-/*! SAN & VSR : Test QT_EVENT
-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-*/
/*! Sets a definite study to be current.
*/
void SetCurrentStudy(in SALOMEDS::Study theStudy);
\param theView3d The 3D view, where the animation will be rendered.
*/
Animation CreateAnimation(in View3D theView3d);
+
+ void DeleteResult(in Result theResult);
+
+ void DeletePrs3d(in Prs3d thePrs3d);
+
};
/*! \brief %View interface
%View interface is a base for all types of %view interfaces.
*/
interface View: Base{
+
+ enum ViewRepresentation { OBJECTBROWSER, VIEWER, PYTHON, MESSAGES }; // displaying part ("ALL" isn't setable)
+
+ void ShowPart (in ViewRepresentation ViewRepr, in boolean state );
+
+ boolean IsPartShown( in ViewRepresentation ViewRepr );
+
+ void SetViewWidth (in long Width); //setting width of view
+
+ void SetViewHeight (in long Height); //setting height of view
+
+ long GetViewWidth(); //getting view width
+
+ long GetViewHeight(); //getting view height
+
+ enum ViewPosition {TOP, CENTER, BOTTOM, RIGHT, LEFT}; //position of the study frame
+
+ void SetViewPositionHorizontal (in ViewPosition ViewPosHor); //setting of the horizontal view position
+
+ void SetViewPositionVertical (in ViewPosition ViewPosVer); //setting of the vertical view position
+
+ void SetRelativePosition( in double x, in double y );
+ void SetRelativeSize( in double x, in double y );
/*!
Sets the title of the %View frame.
\param theTitle String parameter defining the title of the %View frame.
void parseFile(const char* theFileName) {
try{
- cout<<"'"<<theFileName<<"'...\n";
+ MESSAGE("'"<<theFileName<<"'...");
auto_ptr<VISU_Convertor> aCon(CreateConvertor(theFileName));
//aCon->GetSize();
//return;
}
}
OK:
- cout<<"OK"<<endl;
- }catch(std::runtime_error& exc){
- MESSAGE("Follow exception was accured in file:"<<theFileName<<"\n"<<exc.what());
+ MESSAGE("OK");
+ }catch(std::exception& exc){
+ MESSAGE("Follow exception was occured in file:"<<theFileName<<"\n"<<exc.what());
}catch(...){
- MESSAGE("Unknown exception was accured in VISU_Convertor_impl in file:"<<theFileName);
+ MESSAGE("Unknown exception was occured in VISU_Convertor_impl in file:"<<theFileName);
}
}
}
return 0;
}
- }catch(std::runtime_error& exc){
- cout<<"Follow exception was accured :\n"<<exc.what()<<endl;
+ }catch(std::exception& exc){
+ MESSAGE("Follow exception was occured :\n"<<exc.what());
}catch(...){
- cout<<"Unknown exception was accured in VISU_Convertor_impl"<<endl;
+ MESSAGE("Unknown exception was occured in VISU_Convertor_impl");
}
return 1;
}
int aMeshDimension = theMesh.myDim;
bool anIsDimPresent[3] = {false, false, false};
for(int iDim = 0; iDim < aMeshDimension; iDim++){
- string aDimName = theMesh.myPointsDim.at(iDim);
+ string aDimName = theMesh.myPointsDim[iDim];
if(aDimName == "x" || aDimName == "X")
anIsDimPresent[eX] = true;
else if(aDimName == "y" || aDimName == "Y")
//anExtractFilter->DebugOn();
try{
LoadMeshOnEntity(*pVTKMeshOnEntity);
- }catch(std::runtime_error& exc){
+ }catch(std::exception& exc){
pVTKMeshOnEntity = pMeshOnEntity;
- MESSAGE("Follow exception was accured :\n"<<exc.what());
+ MESSAGE("Follow exception was occured :\n"<<exc.what());
}catch(...){
pVTKMeshOnEntity = pMeshOnEntity;
- MESSAGE("Unknown exception was accured!");
+ MESSAGE("Unknown exception was occured!");
}
GetMeshOnEntity(pVTKMeshOnEntity->myMeshName,pVTKMeshOnEntity->myEntity);
}
+ void VISU_Gen_i::DeleteResult(Result_ptr theResult){
+ myVisuGen->DeleteResult(theResult);
+ }
+
+
+ void VISU_Gen_i::DeletePrs3d(Prs3d_ptr thePrs3d){
+ myVisuGen->DeletePrs3d(thePrs3d);
+ }
+
+
void VISU_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent){
myVisuGen->Close(theComponent);
}
return myVisuGen->PasteInto(theStream,theObjectID,theObject);
}
-
- /*! SAN & VSR : Test QT_EVENT
- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- */
- void VISU_Gen_i::CreateTestView() {
- myVisuGen->CreateTestView();
- }
- void VISU_Gen_i::ShowTestObject() {
- myVisuGen->ShowTestObject();
- }
- /*! SAN & VSR : Test QT_EVENT
- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- */
-
};
virtual Container_ptr CreateContainer();
virtual Animation_ptr CreateAnimation(View3D_ptr theView3d);
+ virtual void DeleteResult(Result_ptr theResult);
+ virtual void DeletePrs3d(Prs3d_ptr thePrs3d);
+
// inherited methods from SALOMEDS::Driver
virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
const char* theURL,
SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
CORBA::Long theObjectID,
SALOMEDS::SObject_ptr theObject);
- /*! SAN & VSR : Test QT_EVENT
- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- */
- virtual void CreateTestView();
- virtual void ShowTestObject();
- /*! SAN & VSR : Test QT_EVENT
- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- */
};
};
#include "VISU_Actor.h"
#include "VISU_PipeLine.hxx"
+#include "SALOME_ShrinkFilter.h"
+#include "SALOME_GeometryFilter.h"
#include "SALOME_PassThroughFilter.h"
-#include "utilities.h"
+#include <stdexcept>
+
// VTK Includes
#include <vtkProperty.h>
-#include <vtkDataSetMapper.h>
+
+#include <vtkDataSet.h>
+#include <vtkPolyData.h>
+#include <vtkUnstructuredGrid.h>
+
+#include <vtkShrinkFilter.h>
#include <vtkShrinkPolyData.h>
+
+#include <vtkDataSetMapper.h>
#include <vtkGeometryFilter.h>
#include <vtkObjectFactory.h>
+#include "utilities.h"
+
using namespace std;
static int MYVTKDEBUG = 0;
myIsShrunk = false;
myIsShrinkable = false;
- myShrinkFilter = vtkShrinkPolyData::New();
+ myShrinkFilter = SALOME_ShrinkFilter::New();
+ myShrinkFilter->SetStoreMapping(true);
+ SetShrinkFactor();
+
+ myMapper = vtkDataSetMapper::New();
myIO = NULL;
myName = "";
- ishighlighted = false;
- IsHighlighting = true;
- HighlightProperty = vtkProperty::New();
- HighlightProperty->SetAmbient(0.5);
- HighlightProperty->SetDiffuse(0.3);
- HighlightProperty->SetSpecular(0.2);
- HighlightProperty->SetRepresentationToSurface();
- HighlightProperty->SetAmbientColor(1, 1, 1);
- HighlightProperty->SetDiffuseColor(1, 1, 1);
- HighlightProperty->SetSpecularColor(0.5, 0.5, 0.5);
-
- vtkProperty* aProperty = this->GetProperty();
+ vtkProperty* aProperty = GetProperty();
aProperty->SetAmbient(0.5);
aProperty->SetDiffuse(0.2);
aProperty->SetSpecular(0.2);
VISU_Actor::~VISU_Actor(){
SALOME_Actor::SetProperty(NULL);
- HighlightProperty->Delete();
- if(myPipeLine) myPipeLine->UnRegister(this);
+
+ myMapper->RemoveAllInputs();
+ myMapper->Delete();
+
+ if(myPipeLine)
+ myPipeLine->UnRegister(this);
myShrinkFilter->UnRegisterAllOutputs();
myShrinkFilter->Delete();
//Now, we use vtkShrinkPolyData (not vtkShrinkFilter),
//and the class there is no such limitation.
- vtkDataSetMapper* aNewMapper = vtkDataSetMapper::New();
- aNewMapper->SetInput(aDataSet);
- SetMapper(aNewMapper);
- aNewMapper->Delete();
+ myMapper->SetInput(aDataSet);
+ SetMapper(myMapper);
}
}
void VISU_Actor::SetRepresentation(int theMode) {
SALOME_Actor::SetRepresentation(theMode);
+ if(myRepresentation == VTK_POINTS)
+ UnShrink();
}
void VISU_Actor::SetOpacity(float theValue){
return GetProperty()->GetOpacity();
}
-void VISU_Actor::SetShrinkable(bool theIsShrinkable){
- myIsShrinkable = theIsShrinkable;
-}
-void VISU_Actor::SetShrink(float theFactor){
+void VISU_Actor::SetShrink(){
if(!myIsShrinkable) return;
- //_CS_PhB operator [] if(vtkPolyData* aDataSet = myPassFilter.at(1)->GetPolyDataOutput()){
- if(vtkPolyData* aDataSet = myPassFilter[1]->GetPolyDataOutput()){
- myShrinkFilter->SetShrinkFactor(theFactor);
+ if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){
myShrinkFilter->SetInput(aDataSet);
- //_CS_PhB operator [] myPassFilter.at(2)->SetInput(myShrinkFilter->GetOutput());
- myPassFilter[2]->SetInput(myShrinkFilter->GetOutput());
+ myPassFilter[1]->SetInput(myShrinkFilter->GetOutput());
myIsShrunk = true;
}
}
void VISU_Actor::UnShrink(){
if(!myIsShrunk) return;
- //_CS_PhB operator [] if(vtkPolyData* aDataSet = myPassFilter.at(1)->GetPolyDataOutput()){
- if(vtkPolyData* aDataSet = myPassFilter[1]->GetPolyDataOutput()){
- //_CS_PhB operator [] myPassFilter.at(2)->SetInput(aDataSet);
- //_CS_PhB operator [] myPassFilter.at(2)->Modified();
- myPassFilter[2]->SetInput(aDataSet);
- myPassFilter[2]->Modified();
+ if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){
+ myPassFilter[1]->SetInput(aDataSet);
+ myPassFilter[1]->Modified();
myIsShrunk = false;
+ Modified();
}
}
+void VISU_Actor::SetShrinkable(bool theIsShrinkable){
+ myIsShrinkable = theIsShrinkable;
+}
+
+void VISU_Actor::SetShrinkFactor(float theValue){
+ myShrinkFilter->SetShrinkFactor(theValue);
+ Modified();
+}
+
+float VISU_Actor::GetShrinkFactor(){
+ return myShrinkFilter->GetShrinkFactor();
+}
+
+
+//----------------------------------------------------------------------------
void VISU_Actor::SetVisibility(int theMode){
SALOME_Actor::SetVisibility(theMode);
}
return GetProperty()->GetLineWidth();
}
+//----------------------------------------------------------------------------
void VISU_Actor::ShallowCopy(vtkProp *prop){
VISU_Actor *anActor = VISU_Actor::SafeDownCast(prop);
if(anActor != NULL){
SALOME_Actor::ShallowCopy(prop);
}
-void VISU_Actor::highlight(Standard_Boolean highlight) {
- if (this->IsHighlighting) {
- if(highlight && !ishighlighted) {
- ishighlighted=true;
- this->SetProperty(HighlightProperty);
- }else if (!highlight)
- if(ishighlighted) ishighlighted=false;
- }
-}
-
-int VISU_Actor::GetObjId(int theVtkID){
- if (GetRepresentation() == 0) return -1; // points
- return myGeomFilter->GetObjId(theVtkID);
+//----------------------------------------------------------------------------
+int VISU_Actor::GetNodeObjId(int theVtkID){
+ if ( myIsShrunk )
+ return myShrinkFilter->GetNodeObjId(theVtkID);
+ return theVtkID;
}
-VISU_Actor::TVectorId VISU_Actor::GetVtkId(int theObjID){
- return myGeomFilter->GetVtkId(theObjID);
+int VISU_Actor::GetElemObjId(int theVtkID){
+ return myGeomFilter->GetElemObjId(theVtkID);
}
#define VISU_ACTOR_H
#include "SALOME_Actor.h"
-#include "SALOME_GeometryFilter.h"
-#include <stdexcept>
#include <string>
class vtkProp;
class vtkProperty;
-class vtkShrinkPolyData;
+class vtkDataSetMapper;
+class SALOME_ShrinkFilter;
class VISU_PipeLine;
namespace VISU {
vtkTypeMacro(VISU_Actor,SALOME_Actor);
void ShallowCopy(vtkProp *prop);
static VISU_Actor* New();
- ~VISU_Actor();
+ virtual ~VISU_Actor();
virtual void setIO(const Handle(SALOME_InteractiveObject)& theIO);
VISU_Actor* GetParent(){ return myParent;}
virtual void SetParent(VISU_Actor* theParent);
- virtual void highlight(Standard_Boolean highlight);
- Standard_Boolean isHighlighted() { return true; };
-
virtual void SetOpacity(float theValue);
virtual float GetOpacity();
- virtual void SetShrinkable(bool theIsShrinkable);
- virtual bool GetShrinkable() { return myIsShrinkable;}
-
virtual void SetRepresentation(int theMode);
+
+ virtual bool IsShrunkable() { return myIsShrinkable;}
virtual bool IsShrunk() { return myIsShrunk;}
- virtual void SetShrink(float theFactor = 0.8);
+ virtual void SetShrink();
virtual void UnShrink();
+ virtual void SetShrinkable(bool theIsShrinkable);
+ virtual void SetShrinkFactor(float theFactor = 0.8);
+ virtual float GetShrinkFactor();
+
+
virtual void SetVisibility(int theMode);
virtual int GetVisibility();
virtual void SetLineWidth(float theLineWidth);
virtual float GetLineWidth();
- int GetObjId(int theVtkID);
- TVectorId GetVtkId(int theObjID);
- bool IsHighlighting;
+ virtual int GetNodeObjId(int theVtkID);
+ virtual int GetElemObjId(int theVtkID);
+
+
std::string myFieldName;
protected:
VISU_Actor* myParent;
VISU::Prs3d_i* myPrs3d;
VISU_PipeLine* myPipeLine;
- vtkProperty* HighlightProperty;
+ vtkDataSetMapper* myMapper;
- vtkShrinkPolyData* myShrinkFilter;
+ SALOME_ShrinkFilter* myShrinkFilter;
bool myIsShrinkable;
bool myIsShrunk;
};
#include "VISU_MeshAct.h"
#include "SALOME_PassThroughFilter.h"
+#include <vtkObjectFactory.h>
+#include <vtkRenderer.h>
+#include <vtkTexture.h>
+
#include <vtkFeatureEdges.h>
#include <vtkDataSetMapper.h>
#include <vtkDataSet.h>
myNodeActor->SetShrinkable(theIsShrinkable);
}
+void VISU_MeshAct::SetShrinkFactor(float theValue){
+ VISU_Actor::SetShrinkFactor(theValue);
+ mySurfaceActor->SetShrinkFactor(theValue);
+ myEdgeActor->SetShrinkFactor(theValue);
+}
+
vtkProperty* VISU_MeshAct::GetSurfaceProperty(){
- mySurfaceActor->GetProperty();
+ return mySurfaceActor->GetProperty();
}
void VISU_MeshAct::SetSurfaceProperty(vtkProperty* theProperty){
}
vtkProperty* VISU_MeshAct::GetEdgeProperty(){
- myEdgeActor->GetProperty();
+ return myEdgeActor->GetProperty();
}
void VISU_MeshAct::SetEdgeProperty(vtkProperty* theProperty){
}
vtkProperty* VISU_MeshAct::GetNodeProperty(){
- myNodeActor->GetProperty();
+ return myNodeActor->GetProperty();
}
void VISU_MeshAct::SetNodeProperty(vtkProperty* theProperty){
myNodeActor->SetProperty(theProperty);
}
-void VISU_MeshAct::highlight(Standard_Boolean highlight){
- VISU_Actor::highlight(highlight);
- mySurfaceActor->highlight(highlight);
- myEdgeActor->highlight(highlight);
- myNodeActor->highlight(highlight);
-}
-
void VISU_MeshAct::SetOpacity(float theValue){
GetSurfaceProperty()->SetOpacity(theValue);
}
return GetEdgeProperty()->GetLineWidth();
}
-void VISU_MeshAct::SetShrink(float theFactor){
- VISU_Actor::SetShrink(theFactor);
- mySurfaceActor->SetShrink(theFactor);
- myEdgeActor->SetShrink(theFactor);
- SetRepresentation(GetRepresentation());
+void VISU_MeshAct::SetShrink(){
+ if(myRepresentation == VTK_POINTS)
+ return;
+ VISU_Actor::SetShrink();
+ mySurfaceActor->SetShrink();
+ myEdgeActor->SetShrink();
+ //SetRepresentation(GetRepresentation());
}
void VISU_MeshAct::UnShrink(){
VISU_Actor::UnShrink();
mySurfaceActor->UnShrink();
myEdgeActor->UnShrink();
- SetRepresentation(GetRepresentation());
+ //SetRepresentation(GetRepresentation());
}
void VISU_MeshAct::SetRepresentation(int theMode){
myEdgeActor->PickableOff();
myNodeActor->PickableOff();
switch(theMode){
- case 0: //POINTS
+ case VTK_POINTS:
myNodeActor->VisibilityOn();
myNodeActor->PickableOn();
break;
- case 1: //WIREFRAME
+ case VTK_WIREFRAME:
myEdgeActor->VisibilityOn();
myEdgeActor->SetRepresentation(1);
myEdgeActor->PickableOn();
break;
- case 2: //SURFACE
+ case VTK_SURFACE:
mySurfaceActor->VisibilityOn();
break;
case 3: //INSIDEFRAME
mySurfaceActor->VisibilityOn();
break;
}
+ if(myRepresentation == VTK_POINTS)
+ UnShrink();
}
void VISU_MeshAct::SetVisibility(int theMode){
virtual void SetPipeLine(VISU_PipeLine* thePipeLine) ;
virtual void SetTransform(SALOME_Transform* theTransform);
- virtual void highlight(Standard_Boolean highlight);
-
virtual vtkProperty* GetSurfaceProperty();
virtual void SetSurfaceProperty(vtkProperty* theProperty);
virtual void SetVisibility(int theMode);
virtual void SetShrinkable(bool theIsShrinkable);
+ virtual void SetShrinkFactor(float theFactor = 0.8);
- virtual void SetShrink(float theFactor = 0.8);
+ virtual void SetShrink();
virtual void UnShrink();
virtual void Render(vtkRenderer *, vtkMapper *);
#include "VISU_LookupTable.hxx"
#include "VISU_ScalarBarActor.hxx"
+#include <vtkObjectFactory.h>
+#include <vtkRenderer.h>
+
vtkStandardNewMacro(VISU_ScalarMapAct);
VISU_ScalarMapAct::VISU_ScalarMapAct(){
// VTK Includes
#include <vtkObjectFactory.h>
+#include <vtkDataSetMapper.h>
+#include <vtkPolyDataMapper.h>
+#include <vtkPolyData.h>
using namespace std;
void VISU_VectorsAct::SetPipeLine(VISU_PipeLine* thePipeLine) {
- if(myPipeLine = dynamic_cast<VISU_VectorsPL*>(thePipeLine)){
+ if((myPipeLine = dynamic_cast<VISU_VectorsPL*>(thePipeLine))){
VISU_Actor::SetPipeLine(myPipeLine);
myPipeLine->Delete();
}
#include <vtkCamera.h>
#include <vtkActor.h>
+#include "utilities.h"
+
using namespace std;
static int isOnlyMesh = false;
}
}
}
- }catch(std::runtime_error& exc){
- cout<<"Follow exception was accured :\n"<<exc.what()<<endl;
+ }catch(std::exception& exc){
+ MESSAGE("Follow exception was occured :\n"<<exc.what());
}catch(...){
- cout<<"Unknown exception was accured in VISU_Convertor_impl"<<endl;
+ MESSAGE("Unknown exception was occured in VISU_Convertor_impl");
}
return 1;
}
case YZ: return myAng[theNum][1];
case ZX: return myAng[theNum][2];
}
+ return 0;
}
float VISU_CutPlanesPL::GetRotateY(int theNum){
case YZ: return myAng[theNum][2];
case ZX: return myAng[theNum][0];
}
+ return 0;
}
#include "SALOMEGUI_TableDlg.h"
#include "SALOMEGUI_SetupCurveDlg.h"
#include "SALOMEGUI_SetValueDlg.h"
+#include "SALOMEGUI_Desktop.h"
#include "Plot2d_SetupPlot2dDlg.h"
#include "Plot2d_ViewFrame.h"
#include "VTKViewer_ViewFrame.h"
+#include "VTKViewer_RenderWindow.h"
#include "VTKViewer_InteractorStyleSALOME.h"
+#include "VTKViewer_RenderWindowInteractor.h"
#include "VisuGUI_FileDlg.h"
// QT Includes
#include CORBA_CLIENT_HEADER(MED_Gen)
#include <vtkActor.h>
+#include <vtkRenderer.h>
#include <vtkDataSetMapper.h>
+#include <vtkActorCollection.h>
// Open CASCADE Include
#include <TCollection_AsciiString.hxx>
QFont font;
};
-static VisuGUI MYVISUGUI("");
+
+inline bool IsSObjectTable(SALOMEDS::SObject_ptr theSObject){
+ if(!theSObject->_is_nil()) {
+ SALOMEDS::GenericAttribute_var anAttr;
+ if(theSObject->FindAttribute( anAttr, "AttributeTableOfInteger" ))
+ return true;
+ if(theSObject->FindAttribute( anAttr, "AttributeTableOfReal" ))
+ return true;
+ }
+ return false;
+}
+
+
+static VisuGUI MYVISUGUI;
VisuGUI *visuGUI = &MYVISUGUI;
VISU::VISU_Gen_i* VisuGUI::GetVisuGen(){
}
theViewFrame->getRenderer()->ResetCameraClippingRange();
theViewFrame->onViewFitAll();
+ return aCameraOrient;
}
QAD_Desktop* VisuGUI::GetDesktop(){
// function : ErasePrs()
// purpose :
//=====================================================================================
-void VisuGUI::ErasePrs() {
- if(MYDEBUG) MESSAGE("VisuGUI::ErasePrs");
- CORBA::Object_var anObject = GetSelectedObj();
- 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(MYDEBUG) MESSAGE("VisuGUI::ErasePrs : Prs3d object");
- ErasePrs(aPrsObject);
- VTKViewer_ViewFrame* vf = GetVtkViewFrame();
- if (vf) {
- vf->Repaint();
- }
- }
- // is it Curve ?
- VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in());
- if(aCurve){
- if(MYDEBUG) MESSAGE("VisuGUI::ErasePrs : Curve object");
- PlotCurve(aCurve, VISU::eErase );
+static void ErasePrs(CORBA::Object_ptr theObject) {
+ if(MYDEBUG) MESSAGE("ErasePrs");
+ 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()))
+ VisuGUI::PlotCurve(aCurve, VISU::eErase );
+ break;
}
- // is it Container ?
- VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(anObject).in());
- if(aContainer){
- if(MYDEBUG) MESSAGE("VisuGUI::ErasePrs : Container object");
- PlotContainer(aContainer, VISU::eErase );
+ case VISU::TCONTAINER:{
+ if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aBase).in()))
+ VisuGUI::PlotContainer(aContainer, VISU::eErase );
+ break;
}
- // is it Table ?
- VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(anObject).in());
- if(aTable){
- if(MYDEBUG) MESSAGE("VisuGUI::ErasePrs : Table object");
- PlotTable(aTable, VISU::eErase );
+ case VISU::TTABLE:{
+ if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aBase).in()))
+ VisuGUI::PlotTable(aTable, VISU::eErase );
+ break;
}
+ default:{
+ if(VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aBase).in())){
+ VisuGUI::ErasePrs(aPrsObject);
+ if (VTKViewer_ViewFrame* vf = VisuGUI::GetVtkViewFrame())
+ vf->Repaint();
+ }
+ }}
}
}
+void VisuGUI::ErasePrs() {
+ ::ErasePrs(GetSelectedObj());
+}
+
+
//=====================================================================================
// function : DisplayManyPrs()
// purpose :
}
#ifdef CHECKTIME
timer.Stop();
- cout<<"VisuGUI::CreateMesh() - CREATE MESH\n";
+ MESSAGE("VisuGUI::CreateMesh() - CREATE MESH");
timer.Show();
#endif
SetFitAll(vf);
#ifdef CHECKTIME
timer.Stop();
- cout<<"VisuGUI::CreateMesh() - DISPLAY MESH\n";
+ MESSAGE("VisuGUI::CreateMesh() - DISPLAY MESH");
timer.Show();
#endif
//GetActiveStudy()->updateObjBrowser(); //not necessary
if(theActor->IsShrunk())
theActor->UnShrink();
else
- theActor->SetShrink(0.8);
+ theActor->SetShrink();
}
void VisuGUI::ChangeRepresentation(VISU::PresentationType theType) {
}
else if ( theDisplaying == VISU::eDisplay || theDisplaying == VISU::eDisplayOnly ) {
if ( plotCurve ) {
- plotCurve->setHorTitle( strdup( theCurve->GetHorTitle().c_str() ) );
- //plotCurve->setVerTitle( strdup( theCurve->GetVerTitle().c_str() ) );
- plotCurve->setVerTitle( strdup( theCurve->GetName() ) );
- plotCurve->setHorUnits( strdup( theCurve->GetHorUnits().c_str() ) );
- plotCurve->setVerUnits( strdup( theCurve->GetVerUnits().c_str() ) );
+ plotCurve->setHorTitle( theCurve->GetHorTitle().c_str() );
+ //plotCurve->setVerTitle( theCurve->GetVerTitle().c_str() );
+ plotCurve->setVerTitle( theCurve->GetName() );
+ plotCurve->setHorUnits( theCurve->GetHorUnits().c_str() );
+ plotCurve->setVerUnits( theCurve->GetVerUnits().c_str() );
/* - DATA NOT UPDATED */
- if ( !plotCurve->isAutoAssign() ) {
+ double* xList = 0;
+ double* yList = 0;
+ int nbPoints = theCurve->GetData( xList, yList );
+ if ( nbPoints > 0 && xList && yList ) {
+ plotCurve->setData( xList, yList, nbPoints );
+ }
+ if ( !theCurve->IsAuto() ) {
plotCurve->setLine( (Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
plotCurve->setMarker( (Plot2d_Curve::MarkerType)theCurve->GetMarker() );
SALOMEDS::Color color = theCurve->GetColor();
plotCurve->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
- plotCurve->setAutoAssign( theCurve->IsAuto() );
}
+ plotCurve->setAutoAssign( theCurve->IsAuto() );
aPlot->displayCurve( plotCurve, false );
}
else {
newColor.G = crv->getColor().green()/255.;
newColor.B = crv->getColor().blue()/255.;
theCurve->SetColor( newColor );
+ crv->setAutoAssign( theCurve->IsAuto() );
}
}
}
}
else if ( theDisplaying == VISU::eDisplay || theDisplaying == VISU::eDisplayOnly ) {
if ( plotCurve ) {
- plotCurve->setHorTitle( strdup( theCurve->GetHorTitle().c_str() ) );
- //plotCurve->setVerTitle( strdup( theCurve->GetVerTitle().c_str() ) );
- plotCurve->setVerTitle( strdup( theCurve->GetName() ) );
- plotCurve->setHorUnits( strdup( theCurve->GetHorUnits().c_str() ) );
- plotCurve->setVerUnits( strdup( theCurve->GetVerUnits().c_str() ) );
- /* DATA NOT UPDATED */
- if ( !plotCurve->isAutoAssign() ) {
+ plotCurve->setHorTitle( theCurve->GetHorTitle().c_str() );
+ //plotCurve->setVerTitle( ( theCurve->GetVerTitle().c_str() ) );
+ plotCurve->setVerTitle( theCurve->GetName() );
+ plotCurve->setHorUnits( theCurve->GetHorUnits().c_str() );
+ plotCurve->setVerUnits( theCurve->GetVerUnits().c_str() );
+ double* xList = 0;
+ double* yList = 0;
+ int nbPoints = theCurve->GetData( xList, yList );
+ if ( nbPoints > 0 && xList && yList ) {
+ plotCurve->setData( xList, yList, nbPoints );
+ }
+ if ( !theCurve->IsAuto() ) {
plotCurve->setLine( (Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
plotCurve->setMarker( (Plot2d_Curve::MarkerType)theCurve->GetMarker() );
SALOMEDS::Color color = theCurve->GetColor();
plotCurve->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
- plotCurve->setAutoAssign( theCurve->IsAuto() );
}
+ plotCurve->setAutoAssign( theCurve->IsAuto() );
aPlot->displayCurve( plotCurve, false );
}
else {
newColor.G = crv->getColor().green()/255.;
newColor.B = crv->getColor().blue()/255.;
theCurve->SetColor( newColor );
+ crv->setAutoAssign( theCurve->IsAuto() );
}
}
}
for ( int k = 1; k <= nbCurves; k++ ) {
VISU::Curve_i* theCurve = container->GetCurve( k );
if ( theCurve && theCurve->IsValid() ) {
- Plot2d_Curve* plotCurve = aPlot->getCurveByIO( new SALOME_InteractiveObject( strdup(theCurve->GetEntry()), "", "" ) );
+ Plot2d_Curve* plotCurve = aPlot->getCurveByIO( new SALOME_InteractiveObject( theCurve->GetEntry(), "", "" ) );
// for ( int i = 0; i < clist.count(); i++ ) {
// if ( clist.at( i )->hasIO() && !strcmp( clist.at( i )->getIO()->getEntry(), theCurve->GetEntry() ) ) {
// plotCurve = clist.at( i );
}
else if ( theDisplaying == VISU::eDisplay || theDisplaying == VISU::eDisplayOnly ) {
if ( plotCurve ) {
- plotCurve->setHorTitle( strdup( theCurve->GetHorTitle().c_str() ) );
- //plotCurve->setVerTitle( strdup( theCurve->GetVerTitle().c_str() ) );
- plotCurve->setVerTitle( strdup( theCurve->GetName() ) );
- plotCurve->setHorUnits( strdup( theCurve->GetHorUnits().c_str() ) );
- plotCurve->setVerUnits( strdup( theCurve->GetVerUnits().c_str() ) );
- /* - DATA NOT UPDATED */
- if ( !plotCurve->isAutoAssign() ) {
+ plotCurve->setHorTitle( theCurve->GetHorTitle().c_str() );
+ //plotCurve->setVerTitle( ( theCurve->GetVerTitle().c_str() ) );
+ plotCurve->setVerTitle( theCurve->GetName() );
+ plotCurve->setHorUnits( theCurve->GetHorUnits().c_str() );
+ plotCurve->setVerUnits( theCurve->GetVerUnits().c_str() );
+ double* xList = 0;
+ double* yList = 0;
+ int nbPoints = theCurve->GetData( xList, yList );
+ if ( nbPoints > 0 && xList && yList ) {
+ plotCurve->setData( xList, yList, nbPoints );
+ }
+ if ( !theCurve->IsAuto() ) {
plotCurve->setLine( (Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
plotCurve->setMarker( (Plot2d_Curve::MarkerType)theCurve->GetMarker() );
SALOMEDS::Color color = theCurve->GetColor();
plotCurve->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
- plotCurve->setAutoAssign( theCurve->IsAuto() );
}
+ plotCurve->setAutoAssign( theCurve->IsAuto() );
aPlot->displayCurve( plotCurve, false );
}
else {
newColor.G = crv->getColor().green()/255.;
newColor.B = crv->getColor().blue()/255.;
theCurve->SetColor( newColor );
+ crv->setAutoAssign( theCurve->IsAuto() );
}
}
}
// possibly this is Table SObject
SO = GetActiveStudy()->getStudyDocument()->FindObjectID( anIO->getEntry() );
}
- SALOMEDS::GenericAttribute_var anAttr;
- if ( SO->_is_nil() || ( !SO->FindAttribute( anAttr, "AttributeTableOfInteger" )
- && !SO->FindAttribute( anAttr, "AttributeTableOfReal" ) ) )
+
+ if(!IsSObjectTable(SO))
return;
+
SALOMEGUI_TableDlg* dlg = new SALOMEGUI_TableDlg( QAD_Application::getDesktop(),
SO,
false,
if(!aSObject->_is_nil()) {
CORBA::Object_var anObject = VISU::SObjectToObject(aSObject);
VISU::CutLines_var aCutLines = VISU::CutLines::_narrow( anObject );
- SALOMEDS::GenericAttribute_var anAttr;
- if(!aCutLines->_is_nil() ||
- aSObject->FindAttribute( anAttr, "AttributeTableOfInteger") ||
- aSObject->FindAttribute( anAttr, "AttributeTableOfReal" )) {
+ if(!aCutLines->_is_nil() || IsSObjectTable(aSObject)) {
GetVisuGen()->CreateTable(aSObject->GetID());
GetActiveStudy()->updateObjBrowser();
}
if (anIO->hasEntry()){
SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(anIO->getEntry());
if(!aSObject->_is_nil()){
+ SALOMEDS::ChildIterator_var aChildIter = aStudy->NewChildIterator(aSObject);
+ for(aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()){
+ SALOMEDS::SObject_var aChildSObject = aChildIter->Value();
+ CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject);
+ ::ErasePrs(aChildObj);
+ }
SALOMEDS::StudyBuilder_var aStudyBuilder = VisuGUI::NewBuilder();
// There is a transaction
aStudyBuilder->NewCommand();
SALOMEDS::AttributeName_var aName;
QString SOName;
SALOMEDS::SObject_var SO = GetActiveStudy()->getStudyDocument()->FindObjectID( table->GetObjectEntry() );
- if ( !SO->_is_nil() && ( SO->FindAttribute( anAttr, "AttributeTableOfInteger" ) ||
- SO->FindAttribute( anAttr, "AttributeTableOfReal" ) ) ) {
+ if ( IsSObjectTable(SO) ) {
// get name of SObject
if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
aName = SALOMEDS::AttributeName::_narrow( anAttr );
- SOName = strdup( aName->Value() );
+ SOName = aName->Value();
}
Plot2d_SetupPlot2dDlg* dlg = new Plot2d_SetupPlot2dDlg( SO, QAD_Application::getDesktop() );
if ( dlg->exec() == QDialog::Accepted ) {
// check if Table SObject is selected
SALOMEDS::SObject_var SO = GetActiveStudy()->getStudyDocument()->FindObjectID( Sel->firstIObject()->getEntry() );
- if ( !SO->_is_nil() &&
- ( SO->FindAttribute( anAttr, "AttributeTableOfInteger" ) ||
- SO->FindAttribute( anAttr, "AttributeTableOfReal" ) ) ) {
+ if ( IsSObjectTable(SO) ) {
// get name of SObject
if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
aName = SALOMEDS::AttributeName::_narrow( anAttr );
- SOName = strdup( aName->Value() );
+ SOName = aName->Value();
}
Plot2d_SetupPlot2dDlg* dlg = new Plot2d_SetupPlot2dDlg( SO, QAD_Application::getDesktop() );
if ( dlg->exec() == QDialog::Accepted ) {
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeName_var aName;
- if ( !theTableSO->_is_nil() &&
- ( theTableSO->FindAttribute( anAttr, "AttributeTableOfInteger" ) ||
- theTableSO->FindAttribute( anAttr, "AttributeTableOfReal" ) ) ) {
+ if ( IsSObjectTable(theTableSO) ) {
CORBA::Object_var aTable = VISU::SObjectToObject(theTableSO);
CORBA::Object_var aContainer = GetVisuGen()->CreateContainer();
if ( !CORBA::is_nil( aTable ) && !CORBA::is_nil( aContainer ) ) {
}
}
}catch(std::exception& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!");
+ INFOS("Unknown exception was occured!");
}
QApplication::restoreOverrideCursor();
}
bool aIsLocked = isStudyLocked( GetActiveStudy()->getStudyDocument() );
bool isVTKViewer = (GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK);
- thePopup->clear();
SALOME_Selection* aSelection = SALOME_Selection::Selection(GetActiveStudy()->getSelection());
- if ( aSelection->IObjectCount() == 0 ) {
+ QString aParentComponent = ((SALOMEGUI_Desktop*)parent)->getComponentFromSelection();
+ int nbSel = aSelection->IObjectCount();
+
+ thePopup->clear();
+
+ if ( nbSel == 0 ) {
if ( theParent == "Viewer" && isVTKViewer && !aIsLocked)
thePopup->insertItem( "Save view parameters", visuGUI, SLOT( SaveViewParams() ) );
return false;
}
- if( aSelection->IObjectCount() > 1 ) {
+ if( nbSel > 1 ) {
int selMode = checkHomoSelection();
if(MYDEBUG) MESSAGE("VisuGUI::CustomPopup: multiple selection : selMode = "<<selMode );
if ( selMode == homoCurves ) {
aPresMenu->insertItem("Insideframe", visuGUI, SLOT(MakeInsideframe()));
break;
}
- if(anVISUActor->GetShrinkable())
+ if(anVISUActor->IsShrunkable())
if(aType != VISU::TVECTORS && aType != VISU::TSTREAMLINES){
if (anVISUActor->IsShrunk())
aPresMenu->insertItem("Unshrink", visuGUI, SLOT(MakeShrink()));
SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow( anObject );
if(!CORBA::is_nil(aField))
thePopup->insertItem( "Import TimeStamp", visuGUI, SLOT( ImportMedField() ) );
+ if ( aParentComponent != parent->getActiveComponent() ) {
+ //insert pre-defined Display/Erase items
+ if ( thePopup->count() > 0 ) {
+ thePopup->insertSeparator();
+ }
+ thePopup->insertItem (tr ("MEN_APP_DISPLAY"), GetActiveStudy()->getApp(), SLOT(onDisplay(int)), 0, QAD_Display_Popup_ID);
+ thePopup->insertItem (tr ("MEN_APP_DISPLAY_ONLY"), GetActiveStudy()->getApp(), SLOT(onDisplay(int)), 0, QAD_DisplayOnly_Popup_ID);
+ thePopup->insertItem (tr ("MEN_APP_ERASE"), GetActiveStudy()->getApp(), SLOT(onErase()), 0, QAD_Erase_Popup_ID);
+ }
return false;
}
}else{
}
return false;
}else{
- SALOMEDS::GenericAttribute_var anAttr;
- if(aSObject->FindAttribute( anAttr, "AttributeTableOfInteger" ) ||
- aSObject->FindAttribute( anAttr, "AttributeTableOfReal" )){
+
+ if(IsSObjectTable(aSObject)){
thePopup->insertItem( "Show Table", visuGUI, SLOT(ShowTable()));
thePopup->insertItem( "Create Curves", visuGUI, SLOT(PlotData()));
thePopup->insertItem( "Export Table", visuGUI, SLOT( ExportTableToFile() ) );
+ thePopup->insertSeparator();
+ thePopup->insertItem( "Delete", visuGUI, SLOT( DeleteObject() ) );
return false;
}
+
+ CORBA::Long aTag = 1;
+ SALOMEDS::SObject_var aSubObject;
+ if(aSObject->FindSubObject(aTag,aSubObject) && IsSObjectTable(aSubObject)) {
+ thePopup->insertItem( "Delete", visuGUI, SLOT( DeleteObject() ) );
+ return false;
+ }
+
aSObject = aSObject->GetFather();
if(aSObject->_is_nil()) return false;
+ SALOMEDS::GenericAttribute_var anAttr;
aSObject->FindAttribute(anAttr, "AttributeName");
SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
if(aName->_is_nil()) return false;
// thePopup->insertItem( "Import MED", visuGUI, SLOT( ImportMedField() ) );
if(strcmp(aValue.in(),"MEDFIELD") == 0)
thePopup->insertItem( "Import Field", visuGUI, SLOT( ImportMedField() ) );
+ if ( aParentComponent != parent->getActiveComponent() ) {
+ //insert pre-defined Display/Erase items
+ if ( thePopup->count() > 0 ) {
+ thePopup->insertSeparator();
+ }
+ thePopup->insertItem (tr ("MEN_APP_DISPLAY"), GetActiveStudy()->getApp(), SLOT(onDisplay(int)), 0, QAD_Display_Popup_ID);
+ thePopup->insertItem (tr ("MEN_APP_DISPLAY_ONLY"), GetActiveStudy()->getApp(), SLOT(onDisplay(int)), 0, QAD_DisplayOnly_Popup_ID);
+ thePopup->insertItem (tr ("MEN_APP_ERASE"), GetActiveStudy()->getApp(), SLOT(onErase()), 0, QAD_Erase_Popup_ID);
+ }
return false;
}
}
}
+ return false;
}
//===========================================================================
TYPE* pPresent = FCREATE(theField,aMeshName,(VISU::Entity)anEntity.toInt(),aFieldName,aTimeStampId.toInt()); \
if(MYCHECKTIME) { \
timer.Stop(); \
- cout<<"BUILDPRS(TYPE, FCREATE, FNAME, DLGNAME) - CREATE PRSOBJECT\n"; \
+ MESSAGE("BUILDPRS(TYPE, FCREATE, FNAME, DLGNAME) - CREATE PRSOBJECT"); \
timer.Show(); \
} \
if (pPresent) { \
CreateCutPlanesPrs(theField,aMeshName,(VISU::Entity)anEntity.toInt(),aFieldName,aTimeStampId.toInt());
if(MYCHECKTIME) {
timer.Stop();
- cout<<"BUILDPRS(TYPE, FCREATE, FNAME, DLGNAME) - CREATE PRSOBJECT\n";
+ MESSAGE("BUILDPRS(TYPE, FCREATE, FNAME, DLGNAME) - CREATE PRSOBJECT");
timer.Show();
}
if (pPresent) {
aFieldName,aTimeStampId.toInt());
if(MYCHECKTIME) {
timer.Stop();
- cout<<"BUILDPRS(VISU::CutLines_i, CreateCutLinesPrs, VisuGUI::CreateCutLines, VisuGUI_CutLinesDlg) - CREATE PRSOBJECT\n";
+ MESSAGE("BUILDPRS(VISU::CutLines_i, CreateCutLinesPrs, VisuGUI::CreateCutLines, VisuGUI_CutLinesDlg) - CREATE PRSOBJECT");
timer.Show();
}
if (pPresent) {
#ifdef CHECKTIME
timer.Stop();
- cout<<"VisuGUI::ImportTablesFromFile() - IMPORT FILE\n";
+ MESSAGE("VisuGUI::ImportTablesFromFile() - IMPORT FILE");
timer.Show();
#endif
}
#ifdef CHECKTIME
timer.Stop();
- cout<<"VisuGUI::ImportFromFile() - IMPORT FILE\n";
+ MESSAGE("VisuGUI::ImportFromFile() - IMPORT FILE");
timer.Show();
#endif
} else if (theDispOnly) {
anVISUActor->GetParent()->VisibilityOff();
+ } else {
}
+ } else if (theDispOnly && anActor->GetVisibility()) {
+ anActor->VisibilityOff();
+ } else {
}
}
if (aResActor) return aResActor;
tr ("VISU_BUT_OK") );
throw exc;
} catch (...) {
- cout<<" Unknown exception"<<endl;
+ MESSAGE(" Unknown exception");
QApplication::restoreOverrideCursor();
INFOS("Unknown exception is caught in VisuGUI::CreateActor");
INFOS("Available memory : "<<VISU_PipeLine::GetAvailableMemory());
}
#ifdef CHECKTIME
timer.Stop();
- cout<<"VisuGUI::CreateActor(VISU::Prs3d_i* thePrs) - DISPLAY ACTOR\n";
+ MESSAGE("VisuGUI::CreateActor(VISU::Prs3d_i* thePrs) - DISPLAY ACTOR");
timer.Show();
#endif
}
#include <qhgroupbox.h>
#include <vtkRenderer.h>
+#include <vtkPolyData.h>
#include <vtkAppendPolyData.h>
#include <vtkDataSetMapper.h>
#include <qtabwidget.h>
#include <vtkRenderer.h>
+#include <vtkPolyData.h>
#include <vtkAppendPolyData.h>
#include <vtkDataSetMapper.h>
SALOMEDS::AttributeName_var aName;
if ( theSObject->FindAttribute(anAttr, "AttributeName") ) {
aName = SALOMEDS::AttributeName::_narrow( anAttr );
- return QString(strdup( aName->Value() ));
+ return QString(aName->Value());
}
return QString("");
}
void VisuGUI_InitMeshDlg::TextChangedInLineEdit(const QString& newText)
{
QLineEdit* send = (QLineEdit*)sender();
- QString newT = strdup(newText) ;
if (send == LineEdit_NameMesh) {
myNameMesh = newText;
case 1: return VTK_COURIER; \
case 2: return VTK_TIMES; \
} \
+ return VTK_ARIAL; \
}
#define SETFONT(FuncName, Control) \
#include "QAD_RightFrame.h"
#include "VTKViewer_ViewFrame.h"
-#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
#include <map>
#include <qlayout.h>
#include <qhbuttongroup.h>
#include <qradiobutton.h>
+#include <qvalidator.h>
#include <qpushbutton.h>
+#include <vtkDataSetMapper.h>
#include <vtkDataSet.h>
+#include <vtkPointData.h>
+#include <vtkCellData.h>
#include <vtkCell.h>
-#include <qvalidator.h>
#include "utilities.h"
myDZLbl->setText(QString::number( ABS(aCoord[5]-aCoord[4]) ));
}
- TColStd_MapOfInteger aMapIndex;
+ TColStd_IndexedMapOfInteger aMapIndex;
typedef map<int,float*> PointsMap;
PointsMap aPointsMap;
mySelection->GetIndex(anIO, aMapIndex);
- TColStd_MapIteratorOfMapOfInteger anIter(aMapIndex);
VISU_Actor* anActor = visuGUI->GetActor(aPrs3d);
if(!anActor)
return;
- vtkDataSet* aDataSet = anActor->GetMapper()->GetInput();
+ vtkDataSet* aDataSet = anActor->GetInput();
vtkPointData* aPntData = aDataSet->GetPointData();
- for (;anIter.More();anIter.Next()){
- int aID = anIter.Key();
+ for ( int ind = 1; ind <= aMapIndex.Extent(); ind++){
+ int aID = aMapIndex( ind );
switch (aType) {
case 0:
clearFields();
}
else {
- int aDSId = anActor->GetObjId(aID);
- if (aDSId==-1) aDSId = aID;
- myCellIDValLbl->setText( QString::number(aDSId) );
+ myCellIDValLbl->setText( QString::number(aID) );
myCellScalarValLbl->setText(getValue(aData, aID));
myCellVectorValLbl->setText(getVector(aData, aID));
QString theValue,
QLabel* theFieldName)
{
- int anId = theText.toInt();
Handle(SALOME_InteractiveObject) anIO;
if(VISU::Prs3d_i* aPrs3d = visuGUI->GetSelectedPrs3d(&anIO)){
+ int anId = theText.toInt();
vtkDataSet* aDataSet = aPrs3d->GetPL()->GetMapper()->GetInput();
int aMaxId = (aDataSet->*theMethod)();
if(anId < 0) anId = 0;
- if(aMaxId <= anId) anId = aMaxId-1;
+ if(anId >= aMaxId) anId = aMaxId-1;
theSelection->ClearIObjects();
theSelection->AddIObject(anIO);
- VISU_Actor* anVISUActor = visuGUI->GetActor(aPrs3d);
- if(theIsCell){
- VISU_Actor::TVectorId aVec = anVISUActor->GetVtkId(anId);
- if(!aVec.empty()){
- theSelection->AddOrRemoveIndex( anIO, aVec, false );
- return true;
- }
- }else{
- theSelection->AddOrRemoveIndex(anIO, anId, false);
- return true;
- }
+ theSelection->AddOrRemoveIndex( anIO, anId, false );
+ return true;
}else{
theMeshName->setText(theValue);
theFieldName->setText("");
return (i->second)(theSObject,thePrefix,aMap);
}
}catch(std::logic_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!");
+ INFOS("Unknown exception was occured!");
}
return NULL;
}
PortableServer::Servant aServant = aPOA->reference_to_servant(theObject);
return aServant;
} catch (...) {
- INFOS("GetServant - Unknown exception was accured!!!");
+ INFOS("GetServant - Unknown exception was occured!!!");
return NULL;
}
}
anObj = anORB->string_to_object(aValue);
}
}catch(...){
- INFOS("SObjectToObject - Unknown exception was accured!!!");
+ INFOS("SObjectToObject - Unknown exception was occured!!!");
}
return anObj;
}
typedef std::map<std::string,QString> TRestoringMap;
typedef Storable* (*TStorableEngine)(SALOMEDS::SObject_ptr theSObject,
const std::string& thePrefix, const TRestoringMap& theMap);
- typedef std::map<string,TStorableEngine> TCallbackMap;
+ typedef std::map<std::string,TStorableEngine> TCallbackMap;
static void Registry(const char* theComment, TStorableEngine theEngine);
static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString);
static const QString& FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL);
//===========================================================================
const CORBA::Boolean IsMultifile();
- QString GenerateName(const string& theFmt, int theId);
+ QString GenerateName(const std::string& theFmt, int theId);
PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject);
CORBA::Object_var SObjectToObject(SALOMEDS::SObject_ptr theSObject);
const char* theComment, int IsAllLevels = true);
}
+
#endif
VISU::TMesh &aMesh = myMeshMap[aMeshName.in()];
aMesh.myDim = aMEDMesh->getSpaceDimension();
+ aMesh.myPointsDim.resize(aMesh.myDim);
aMesh.myName = aMeshName.in();
VISUMED::TMesh &aMesh2 = myMeshMap2[aMeshName.in()];
aMesh2.myMesh = aMEDMesh;
VISUMED::TField::TValForTime& aValForTime2 = aField2.myValField[iTimeStamp];
aValForTime2.myField = myField;
if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - aFieldName = '"<<aFieldName<<"'; myId = "<<aField.myId<<"; myTime = "<<dt);
+ MESSAGE("VISU_MEDFieldConvertor::Build - aFieldName = '"<<aFieldName<<"'; myId = "<<aField.myId<<"; myTime = "<<dt);
return this;
}
CORBA::Object_var aMedObject = SObjectToObject(mySObject);
if(!CORBA::is_nil(aMedObject)){
SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(aMedObject);
- if(!aMED->_is_nil()){
- CORBA::Short aTag = mySObject->Tag();
- SALOMEDS::SObject_var aMedCompSObj = mySObject->GetFather();
- SALOMEDS::SObject_var aMeshSObj;
- if(!aMedCompSObj->FindSubObject(aTag+1,aMeshSObj))
- throw std::runtime_error("VISU_MEDConvertor::Build >> Cann't find MEDMESH label !!!");
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - MEDMESH found.");
- SALOMEDS::ChildIterator_var aMeshIterator = aStudy->NewChildIterator(aMeshSObj);
- for(; aMeshIterator->More(); aMeshIterator->Next()){
- aMeshSObj = aMeshIterator->Value();
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aMeshSObj = '"<<::GetName(aMeshSObj)<<"'");
- CORBA::Object_var aMedMesh = SObjectToObject(aMeshSObj);
- if(CORBA::is_nil(aMedMesh)) continue;
- SALOME_MED::MESH_var aMEDMesh = SALOME_MED::MESH::_narrow(aMedMesh);
- if(aMEDMesh->_is_nil()) continue;
- CORBA::String_var aMeshName = aMEDMesh->getName();
- VISU::TMesh &aMesh = myMeshMap[aMeshName.in()];
- aMesh.myDim = aMEDMesh->getSpaceDimension();
- aMesh.myName = aMeshName.in();
- aMesh.myPointsDim.resize(aMesh.myDim);
- VISUMED::TMesh &aMesh2 = myMeshMap2[aMeshName.in()];
- aMesh2.myMesh = aMEDMesh;
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aMeshName = "<<aMeshName<<"; myDim = "<<aMesh.myDim);
- SALOMEDS::ChildIterator_var aSupportIterator = aStudy->NewChildIterator(aMeshSObj);
- for(; aSupportIterator->More(); aSupportIterator->Next()){
- SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
- CORBA::Object_var aMedSupport = SObjectToObject(aSupportSObj);
- if(CORBA::is_nil(aMedSupport)) continue;
- SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport);
- if(aMEDSupport->_is_nil()) continue;
- SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
- SALOME_MED::medEntityMesh aMEDEntity = aMEDSupport->getEntity();
- VISU::TEntity anEntity = aMed2VisuEntity[aMEDEntity];
- CORBA::String_var aSupportName = aMEDSupport->getName();
- if(aMEDSupport->isOnAllElements()){
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - Support isOnAllElements = '"<<aSupportName<<"' anEntity = "<<anEntity);
- int aNbCells, aCellsSize;
- //Check, if there is any data on the support?
- if(anEntity == VISU::NODE_ENTITY){
- aMesh.myNbPoints = aMeshOnSupport->getNumberOfNodes();
- aNbCells = aMesh.myNbPoints;
- aCellsSize = 2*aMesh.myNbPoints;
- }else{
- GetCellsSize(aNbCells,aCellsSize,aMeshOnSupport,anEntity);
- }
- if(aNbCells == 0) continue;
- VISU::TMeshOnEntity& aMeshOnEntity = aMesh.myMeshOnEntityMap[anEntity];
- aMeshOnEntity.myMeshName = aMeshName.in();
- aMeshOnEntity.myEntity = anEntity;
- aMeshOnEntity.myNbCells = aNbCells;
- aMeshOnEntity.myCellsSize = aCellsSize;
-
- VISUMED::TMeshOnEntity& aMeshOnEntity2 = aMesh2.myMeshOnEntityMap[anEntity];
- aMeshOnEntity2.mySupport = aMEDSupport;
- }else{
- SALOME_MED::FAMILY_var aMEDFamily = SALOME_MED::FAMILY::_narrow(aMedSupport);
- if(!aMEDFamily->_is_nil()) {
- int aNbCells, aCellsSize;
- GetCellsSize(aNbCells,aCellsSize,aMEDFamily);
- if(aNbCells > 0){
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aFamily = '"<<aSupportName<<"' anEntity = "<<anEntity);
- VISU::TMeshOnEntity& aMeshOnEntity = aMesh.myMeshOnEntityMap[anEntity];
- VISU::TFamily& aFamily = aMeshOnEntity.myFamilyMap[aSupportName.in()];
- aFamily.myName = aSupportName.in();
- aFamily.myEntity = anEntity;
- aFamily.myNbCells = aNbCells;
- aFamily.myCellsSize = aCellsSize;
- aFamily.myId = aMEDFamily->getIdentifier();
-
- VISUMED::TMeshOnEntity& aMeshOnEntity2 = aMesh2.myMeshOnEntityMap[anEntity];
- VISUMED::TFamily& aFamily2 = aMeshOnEntity2.myFamilyMap[aSupportName.in()];
- aFamily2.myFamily = aMEDFamily;
- }
- }
- SALOME_MED::GROUP_var aMEDGroup = SALOME_MED::GROUP::_narrow(aMedSupport);
- if(!aMEDGroup->_is_nil()) {
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup = '"<<aSupportName<<"' anEntity = "<<anEntity);
- VISUMED::TGroupMap& aGroupMap2 = aMesh2.myGroupMap;
- VISUMED::TGroup& aGroup2 = aGroupMap2[aSupportName.in()];
- aGroup2.myGroup = aMEDGroup;
- SALOME_MED::Family_array_var aFamilies = aMEDGroup->getFamilies();
- int iFamilyEnd = aFamilies->length();
- for(int iFamaily = 0; iFamaily < iFamilyEnd; iFamaily++){
- aMEDFamily = aFamilies[iFamaily];
- CORBA::String_var aFamilyName = aMEDFamily->getName();
- VISU::TMeshOnEntity& aMeshOnEntity = aMesh.myMeshOnEntityMap[anEntity];
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"'");
- VISU::TFamily& aFamily = aMeshOnEntity.myFamilyMap[aFamilyName.in()];
- VISU::TBindGroups& aBindGroups = aFamily.myGroups;
- aBindGroups.insert(aSupportName.in());
- }
- }
- }
- }
- //Correction of TMesh.TGroupMap
- const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh.myMeshOnEntityMap;
- if(aMeshOnEntityMap.empty()) continue;
- VISU::TGroupMap& aGroupMap = aMesh.myGroupMap;
- VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
- for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
- const VISU::TMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
- const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity.myFamilyMap;
- if(aFamilyMap.empty()) continue;
- VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
- for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
- const VISU::TFamily& aFamily = aFamilyMapIter->second;
- const VISU::TBindGroups& aBindGroups = aFamily.myGroups;
- if(aBindGroups.empty()) continue;
- VISU::TBindGroups::const_iterator aBindGroupsIter = aBindGroups.begin();
- for(; aBindGroupsIter != aBindGroups.end(); aBindGroupsIter++){
- const string& aGroupName = *aBindGroupsIter;
- VISU::TGroup& aGroup = aGroupMap[aGroupName];
- aGroup.myName = aGroupName;
- aGroup.myMeshName = aMesh.myName;
- aGroup.myNbCells += aFamily.myNbCells;
- aGroup.myCellsSize += aFamily.myCellsSize;
- VISU::TFamilyAndEntity aFamilyAndEntity(aFamily.myName,aFamily.myEntity);
- aGroup.myFamilyAndEntitySet.insert(aFamilyAndEntity);
- }
- }
- }
- }
- SALOMEDS::SObject_var aFieldSObj;
- if(aMedCompSObj->FindSubObject(aTag+2,aFieldSObj)){
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - MEDFIELD found.");
- SALOMEDS::ChildIterator_var aFieldIterator = aStudy->NewChildIterator(aFieldSObj);
- for(int iField = 0; aFieldIterator->More(); aFieldIterator->Next(), iField++){
- aFieldSObj = aFieldIterator->Value();
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aFieldName = '"<<::GetName(aFieldSObj)<<"'");
- SALOMEDS::ChildIterator_var aTimeStampIterator = aStudy->NewChildIterator(aFieldSObj);
- for(int iTimeStamp = 1; aTimeStampIterator->More(); aTimeStampIterator->Next(), iTimeStamp++){
- SALOMEDS::SObject_var aTimeStampSObj = aTimeStampIterator->Value();
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aTimeStampSObj = '"<<::GetName(aTimeStampSObj)<<"'");
- CORBA::Object_var aMedField = SObjectToObject(aTimeStampSObj);
- if(CORBA::is_nil(aMedField)) continue;
- SALOME_MED::FIELD_var aMEDField = SALOME_MED::FIELD::_narrow(aMedField);
- if(aMEDField->_is_nil()) continue;
- SALOME_MED::SUPPORT_var aMEDSupport = aMEDField->getSupport();
- if(aMEDSupport->_is_nil()) continue;
- SALOME_MED::medEntityMesh aMEDEntity = aMEDSupport->getEntity();
- VISU::TEntity anEntity = aMed2VisuEntity[aMEDEntity];
- SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh();
- if(aMEDMesh->_is_nil()) continue;
- CORBA::String_var aMeshName = aMEDMesh->getName();
- CORBA::String_var aFieldName = aMEDField->getName();
-
- VISU::TMesh &aMesh = myMeshMap[aMeshName.in()];
- aMesh.myDim = aMEDMesh->getSpaceDimension();
- aMesh.myName = aMeshName.in();
- VISUMED::TMesh &aMesh2 = myMeshMap2[aMeshName.in()];
- aMesh2.myMesh = aMEDMesh;
+ return Build(aMED);
+ }
+
+ SALOMEDS::ChildIterator_var aTimeStampIterator = aStudy->NewChildIterator(mySObject);
+ return Build(aTimeStampIterator);
+}
+
+VISU_Convertor* VISU_MEDConvertor::Build(SALOME_MED::MED_ptr theMED)
+{
+ if(theMED->_is_nil()) return NULL;
+ CORBA::Short aTag = mySObject->Tag();
+ SALOMEDS::SObject_var aMedCompSObj = mySObject->GetFather();
+ SALOMEDS::SObject_var aMeshSObj;
+ if(!aMedCompSObj->FindSubObject(aTag+1,aMeshSObj))
+ throw std::runtime_error("VISU_MEDConvertor::Build >> Cann't find MEDMESH label !!!");
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - MEDMESH found.");
+ SALOMEDS::Study_var aStudy = mySObject->GetStudy();
+ SALOMEDS::ChildIterator_var aMeshIterator = aStudy->NewChildIterator(aMeshSObj);
+ for(; aMeshIterator->More(); aMeshIterator->Next()){
+ aMeshSObj = aMeshIterator->Value();
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aMeshSObj = '"<<::GetName(aMeshSObj)<<"'");
+ CORBA::Object_var aMedMesh = SObjectToObject(aMeshSObj);
+ if(CORBA::is_nil(aMedMesh)) continue;
+ SALOME_MED::MESH_var aMEDMesh = SALOME_MED::MESH::_narrow(aMedMesh);
+ if(aMEDMesh->_is_nil()) continue;
+ CORBA::String_var aMeshName = aMEDMesh->getName();
+ VISU::TMesh &aMesh = myMeshMap[aMeshName.in()];
+ aMesh.myDim = aMEDMesh->getSpaceDimension();
+ aMesh.myName = aMeshName.in();
+ aMesh.myPointsDim.resize(aMesh.myDim);
+ VISUMED::TMesh &aMesh2 = myMeshMap2[aMeshName.in()];
+ aMesh2.myMesh = aMEDMesh;
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aMeshName = "<<aMeshName<<"; myDim = "<<aMesh.myDim);
+ SALOMEDS::ChildIterator_var aSupportIterator = aStudy->NewChildIterator(aMeshSObj);
+ for(; aSupportIterator->More(); aSupportIterator->Next()){
+ SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
+ CORBA::Object_var aMedSupport = SObjectToObject(aSupportSObj);
+ if(CORBA::is_nil(aMedSupport)) continue;
+ SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport);
+ if(aMEDSupport->_is_nil()) continue;
+ SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
+ SALOME_MED::medEntityMesh aMEDEntity = aMEDSupport->getEntity();
+ VISU::TEntity anEntity = aMed2VisuEntity[aMEDEntity];
+ CORBA::String_var aSupportName = aMEDSupport->getName();
+ if(aMEDSupport->isOnAllElements()){
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - Support isOnAllElements = '"<<aSupportName<<"' anEntity = "<<anEntity);
+ int aNbCells, aCellsSize;
+ //Check, if there is any data on the support?
+ if(anEntity == VISU::NODE_ENTITY){
+ aMesh.myNbPoints = aMeshOnSupport->getNumberOfNodes();
+ aNbCells = aMesh.myNbPoints;
+ aCellsSize = 2*aMesh.myNbPoints;
+ }else{
+ GetCellsSize(aNbCells,aCellsSize,aMeshOnSupport,anEntity);
+ }
+ if(aNbCells == 0) continue;
+ VISU::TMeshOnEntity& aMeshOnEntity = aMesh.myMeshOnEntityMap[anEntity];
+ aMeshOnEntity.myMeshName = aMeshName.in();
+ aMeshOnEntity.myEntity = anEntity;
+ aMeshOnEntity.myNbCells = aNbCells;
+ aMeshOnEntity.myCellsSize = aCellsSize;
+
+ VISUMED::TMeshOnEntity& aMeshOnEntity2 = aMesh2.myMeshOnEntityMap[anEntity];
+ aMeshOnEntity2.mySupport = aMEDSupport;
+ }else{
+ SALOME_MED::FAMILY_var aMEDFamily = SALOME_MED::FAMILY::_narrow(aMedSupport);
+ if(!aMEDFamily->_is_nil()) {
+ int aNbCells, aCellsSize;
+ GetCellsSize(aNbCells,aCellsSize,aMEDFamily);
+ if(aNbCells > 0){
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aFamily = '"<<aSupportName<<"' anEntity = "<<anEntity);
VISU::TMeshOnEntity& aMeshOnEntity = aMesh.myMeshOnEntityMap[anEntity];
- aMeshOnEntity.myEntity = anEntity;
- aMeshOnEntity.myMeshName = aMeshName.in();
+ VISU::TFamily& aFamily = aMeshOnEntity.myFamilyMap[aSupportName.in()];
+ aFamily.myName = aSupportName.in();
+ aFamily.myEntity = anEntity;
+ aFamily.myNbCells = aNbCells;
+ aFamily.myCellsSize = aCellsSize;
+ aFamily.myId = aMEDFamily->getIdentifier();
+
VISUMED::TMeshOnEntity& aMeshOnEntity2 = aMesh2.myMeshOnEntityMap[anEntity];
- aMeshOnEntity2.mySupport = aMEDSupport;
- if(anEntity == VISU::NODE_ENTITY)
- aMesh2.myMeshOnEntityMap[VISU::CELL_ENTITY].mySupport = aMEDSupport;
- GetCellsSize(aMesh,aMEDMesh,anEntity);
-
- VISU::TField& aField = aMeshOnEntity.myFieldMap[aFieldName.in()];
- aField.myId = iField;
- aField.myName = aFieldName.in();
- aField.myEntity = anEntity;
- aField.myMeshName = aMeshName.in();
- aField.myNbComp = aMEDField->getNumberOfComponents();
- aField.myNbValField = iTimeStamp;
- aField.myDataSize = aMeshOnEntity.myNbCells * aField.myNbComp;
- if(MYDEBUG && !iTimeStamp)
- MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity.myNbCells = "<<aMeshOnEntity.myNbCells);
- aField.myCompNames.resize(aField.myNbComp);
- aField.myUnitNames.resize(aField.myNbComp);
-
- int anId = aMEDField->getIterationNumber();
- VISU::TField::TValForTime& aValForTime = aField.myValField[anId];
- aValForTime.myId = anId;
- aValForTime.myTime = VISU::TField::TTime(aMEDField->getTime(),"");
- VISUMED::TField& aField2 = aMeshOnEntity2.myFieldMap[aFieldName.in()];
- VISUMED::TField::TValForTime& aValForTime2 = aField2.myValField[anId];
- aValForTime2.myField = aMEDField;
- if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<<aMeshName<<
- "'; myEntity = "<<anEntity<<"; myTime = "<<aValForTime.myTime.first);
- }
- }
+ VISUMED::TFamily& aFamily2 = aMeshOnEntity2.myFamilyMap[aSupportName.in()];
+ aFamily2.myFamily = aMEDFamily;
+ }
+ }
+ SALOME_MED::GROUP_var aMEDGroup = SALOME_MED::GROUP::_narrow(aMedSupport);
+ if(!aMEDGroup->_is_nil()) {
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup = '"<<aSupportName<<"' anEntity = "<<anEntity);
+ VISUMED::TGroupMap& aGroupMap2 = aMesh2.myGroupMap;
+ VISUMED::TGroup& aGroup2 = aGroupMap2[aSupportName.in()];
+ aGroup2.myGroup = aMEDGroup;
+ SALOME_MED::Family_array_var aFamilies = aMEDGroup->getFamilies();
+ int iFamilyEnd = aFamilies->length();
+ for(int iFamaily = 0; iFamaily < iFamilyEnd; iFamaily++){
+ aMEDFamily = aFamilies[iFamaily];
+ CORBA::String_var aFamilyName = aMEDFamily->getName();
+ VISU::TMeshOnEntity& aMeshOnEntity = aMesh.myMeshOnEntityMap[anEntity];
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"'");
+ VISU::TFamily& aFamily = aMeshOnEntity.myFamilyMap[aFamilyName.in()];
+ VISU::TBindGroups& aBindGroups = aFamily.myGroups;
+ aBindGroups.insert(aSupportName.in());
+ }
+ }
+ }
+ }
+ //Correction of TMesh.TGroupMap
+ const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh.myMeshOnEntityMap;
+ if(aMeshOnEntityMap.empty()) continue;
+ VISU::TGroupMap& aGroupMap = aMesh.myGroupMap;
+ VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
+ for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
+ const VISU::TMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+ const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity.myFamilyMap;
+ if(aFamilyMap.empty()) continue;
+ VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
+ for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
+ const VISU::TFamily& aFamily = aFamilyMapIter->second;
+ const VISU::TBindGroups& aBindGroups = aFamily.myGroups;
+ if(aBindGroups.empty()) continue;
+ VISU::TBindGroups::const_iterator aBindGroupsIter = aBindGroups.begin();
+ for(; aBindGroupsIter != aBindGroups.end(); aBindGroupsIter++){
+ const string& aGroupName = *aBindGroupsIter;
+ VISU::TGroup& aGroup = aGroupMap[aGroupName];
+ aGroup.myName = aGroupName;
+ aGroup.myMeshName = aMesh.myName;
+ aGroup.myNbCells += aFamily.myNbCells;
+ aGroup.myCellsSize += aFamily.myCellsSize;
+ VISU::TFamilyAndEntity aFamilyAndEntity(aFamily.myName,aFamily.myEntity);
+ aGroup.myFamilyAndEntitySet.insert(aFamilyAndEntity);
+ }
}
- return this;
}
- return NULL;
}
- SALOMEDS::ChildIterator_var aTimeStampIterator = aStudy->NewChildIterator(mySObject);
- for(int iTimeStamp = 1; aTimeStampIterator->More(); aTimeStampIterator->Next(), iTimeStamp++){
- SALOMEDS::SObject_var aTimeStampSObj = aTimeStampIterator->Value();
+ SALOMEDS::SObject_var aFieldSObj;
+ if(aMedCompSObj->FindSubObject(aTag+2,aFieldSObj)){
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - MEDFIELD found.");
+ SALOMEDS::ChildIterator_var aFieldIterator = aStudy->NewChildIterator(aFieldSObj);
+ for(int iField = 0; aFieldIterator->More(); aFieldIterator->Next(), iField++){
+ aFieldSObj = aFieldIterator->Value();
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aFieldName = '"<<::GetName(aFieldSObj)<<"'");
+ SALOMEDS::ChildIterator_var aTimeStampIterator = aStudy->NewChildIterator(aFieldSObj);
+ for(int iTimeStamp = 1; aTimeStampIterator->More(); aTimeStampIterator->Next(), iTimeStamp++){
+ SALOMEDS::SObject_var aTimeStampSObj = aTimeStampIterator->Value();
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aTimeStampSObj = '"<<::GetName(aTimeStampSObj)<<"'");
+ CORBA::Object_var aMedField = SObjectToObject(aTimeStampSObj);
+ if(CORBA::is_nil(aMedField)) continue;
+ SALOME_MED::FIELD_var aMEDField = SALOME_MED::FIELD::_narrow(aMedField);
+ if(aMEDField->_is_nil()) continue;
+ SALOME_MED::SUPPORT_var aMEDSupport = aMEDField->getSupport();
+ if(aMEDSupport->_is_nil()) continue;
+ SALOME_MED::medEntityMesh aMEDEntity = aMEDSupport->getEntity();
+ VISU::TEntity anEntity = aMed2VisuEntity[aMEDEntity];
+ SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh();
+ if(aMEDMesh->_is_nil()) continue;
+ CORBA::String_var aMeshName = aMEDMesh->getName();
+ CORBA::String_var aFieldName = aMEDField->getName();
+
+ VISU::TMesh &aMesh = myMeshMap[aMeshName.in()];
+ aMesh.myDim = aMEDMesh->getSpaceDimension();
+ aMesh.myName = aMeshName.in();
+ VISUMED::TMesh &aMesh2 = myMeshMap2[aMeshName.in()];
+ aMesh2.myMesh = aMEDMesh;
+
+ VISU::TMeshOnEntity& aMeshOnEntity = aMesh.myMeshOnEntityMap[anEntity];
+ aMeshOnEntity.myEntity = anEntity;
+ aMeshOnEntity.myMeshName = aMeshName.in();
+ VISUMED::TMeshOnEntity& aMeshOnEntity2 = aMesh2.myMeshOnEntityMap[anEntity];
+ aMeshOnEntity2.mySupport = aMEDSupport;
+ if(anEntity == VISU::NODE_ENTITY)
+ aMesh2.myMeshOnEntityMap[VISU::CELL_ENTITY].mySupport = aMEDSupport;
+ GetCellsSize(aMesh,aMEDMesh,anEntity);
+
+ VISU::TField& aField = aMeshOnEntity.myFieldMap[aFieldName.in()];
+ aField.myId = iField;
+ aField.myName = aFieldName.in();
+ aField.myEntity = anEntity;
+ aField.myMeshName = aMeshName.in();
+ aField.myNbComp = aMEDField->getNumberOfComponents();
+ aField.myNbValField = iTimeStamp;
+ aField.myDataSize = aMeshOnEntity.myNbCells * aField.myNbComp;
+ if(MYDEBUG && !iTimeStamp)
+ MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity.myNbCells = "<<aMeshOnEntity.myNbCells);
+ aField.myCompNames.resize(aField.myNbComp);
+ aField.myUnitNames.resize(aField.myNbComp);
+
+ int anId = aMEDField->getIterationNumber();
+ VISU::TField::TValForTime& aValForTime = aField.myValField[anId];
+ aValForTime.myId = anId;
+ aValForTime.myTime = VISU::TField::TTime(aMEDField->getTime(),"");
+ VISUMED::TField& aField2 = aMeshOnEntity2.myFieldMap[aFieldName.in()];
+ VISUMED::TField::TValForTime& aValForTime2 = aField2.myValField[anId];
+ aValForTime2.myField = aMEDField;
+ if(MYDEBUG)
+ MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<<aMeshName<<
+ "'; myEntity = "<<anEntity<<"; myTime = "<<aValForTime.myTime.first);
+ }
+ }
+ }
+ return this;
+}
+
+
+VISU_Convertor* VISU_MEDConvertor::Build(SALOMEDS::ChildIterator_ptr theTimeStampIterator)
+{
+ if(theTimeStampIterator->_is_nil()) return NULL;
+ for(int iTimeStamp = 1; theTimeStampIterator->More(); theTimeStampIterator->Next(), iTimeStamp++){
+ SALOMEDS::SObject_var aTimeStampSObj = theTimeStampIterator->Value();
if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aTimeStampSObj = '"<<::GetName(aTimeStampSObj)<<"'");
CORBA::Object_var aMedField = SObjectToObject(aTimeStampSObj);
if(CORBA::is_nil(aMedField)) continue;
VISU::TMesh &aMesh = myMeshMap[aMeshName.in()];
aMesh.myDim = aMEDMesh->getSpaceDimension();
+ aMesh.myPointsDim.resize(aMesh.myDim);
aMesh.myName = aMeshName.in();
aMesh.myNbPoints = aMEDMesh->getNumberOfNodes();
VISUMED::TMesh &aMesh2 = myMeshMap2[aMeshName.in()];
return this;
}
+
int VISU_MEDConvertor::LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity,
const string& theFamilyName)
{
#include "VISUConfig.hh"
#include "VISU_Convertor_impl.hxx"
+#include <string>
+
extern "C"{
#include <med.h>
}
typedef std::map<int,TValForTime> TValField;
TValField myValField;
};
- typedef map<string,TField> TFieldMap;
+ typedef std::map<std::string,TField> TFieldMap;
struct TMeshOnEntity{
SALOME_MED::SUPPORT_var mySupport;
- typedef pair<int,int> TIndexAndSize;
- typedef map<int,TIndexAndSize> TCellsFirstIndex;
+ typedef std::pair<int,int> TIndexAndSize;
+ typedef std::map<int,TIndexAndSize> TCellsFirstIndex;
TCellsFirstIndex myCellsFirstIndex;
TFamilyMap myFamilyMap;
TFieldMap myFieldMap;
VISUMED::TMeshMap myMeshMap2;
SALOMEDS::SObject_var mySObject;
VISU_MEDConvertor() {};
+
public:
VISU_MEDConvertor(SALOMEDS::SObject_ptr theMedSObject) : mySObject(SALOMEDS::SObject::_duplicate(theMedSObject)) {}
- virtual VISU_Convertor* Build() ;
+ virtual VISU_Convertor* Build();
+
protected:
+
+ VISU_Convertor* Build(SALOME_MED::MED_ptr theMED);
+ VISU_Convertor* Build(SALOMEDS::ChildIterator_ptr theTimeStampIterator);
+
virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity,
- const string& theFamilyName = "");
+ const std::string& theFamilyName = "");
virtual int LoadMeshOnGroup(VISU::TMesh& theMesh,
const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet);
VISU::TField& theField,
VISU::TField::TValForTime& theValForTime);
- int LoadPoints(VISU::TMesh& theMesh, const string& theFamilyName = "") ;
+ int LoadPoints(VISU::TMesh& theMesh, const std::string& theFamilyName = "") ;
- int LoadCellsOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, const string& theFamilyName = "");
+ int LoadCellsOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, const std::string& theFamilyName = "");
int LoadField(const VISU::TMeshOnEntity& theMeshOnEntity,
const VISU::TField& theField, VISU::TField::TValForTime& theValForTime);
aTableOfReal->SetRowUnit(iLineId+2,aUnitName.latin1());
}
}
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch (...){
- INFOS("Unknown exception was accured !!!");
+ INFOS("Unknown exception was occured !!!");
}
}
#include "VISU_DeformedShape_i.hh"
#include "VISU_ScalarMapAct.h"
+#include <vtkDataSetMapper.h>
+
using namespace VISU;
using namespace std;
if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck)) return 0;
const VISU::TField& aField = theResult->GetInput()->GetField(theMeshName,(VISU::TEntity)theEntity,theFieldName);
return aField.myNbComp > 1;
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!");
+ INFOS("Unknown exception was occured!");
}
return 0;
}
Mutex mt(myMutex);
SALOMEDS::Study_var aStudy = theComponent->GetStudy();
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
- TCollection_AsciiString aTmpDir =
- isMultiFile?TCollection_AsciiString((char*)theURL):SALOMEDS_Tool::GetTmpDir();
+ const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str();
+ TCollection_AsciiString aTmpDir(const_cast<char*>(aDir));
VisuTmpDir = aTmpDir.ToCString();
SALOMEDS::ListOfFileNames_var aSeq =
SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.ToCString(),isMultiFile);
bool isMultiFile)
{
Mutex mt(myMutex);
- TCollection_AsciiString aTmpDir = isMultiFile? strdup(theURL): SALOMEDS_Tool::GetTmpDir();
+ const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str();
+ TCollection_AsciiString aTmpDir(const_cast<char*>(aDir));
if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
int aCounter = 0;
TColStd_SequenceOfAsciiString aFileNames;
if(aSourceId == Result_i::eFile || aSourceId == Result_i::eRestoredFile){
const QFileInfo& aFileInfo = pResult->GetFileInfo();
QString aPrefix("");
- if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL());
+ 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());
bool isMultiFile)
{
Mutex mt(myMutex);
- CORBA::String_var aString = SALOMEDS_Tool::GetTmpDir();
- TCollection_AsciiString aTmpDir = isMultiFile? (const Standard_CString)theURL: (const Standard_CString)aString.in();
+ const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str();
+ TCollection_AsciiString aTmpDir(const_cast<char*>(aDir));
if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
int aCounter = 0;
TColStd_SequenceOfAsciiString aFileNames;
if(aSourceId == Result_i::eFile || aSourceId == Result_i::eRestoredFile){
const QFileInfo& aFileInfo = pResult->GetFileInfo();
QString aPrefix("");
- if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL());
+ 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());
return aPresent->_this();
else{
aPresent->_remove_ref();
- return VISU::Mesh::_nil();
}
}
+ return VISU::Mesh::_nil();
}
Mesh_ptr VISU_Gen_i::FamilyMeshOnEntity(Result_ptr theResult,
return aPresent->_this();
else{
aPresent->_remove_ref();
- return VISU::Mesh::_nil();
}
}
+ return VISU::Mesh::_nil();
}
Mesh_ptr VISU_Gen_i::GroupMesh(Result_ptr theResult,
return aPresent->_this();
else{
aPresent->_remove_ref();
- return VISU::Mesh::_nil();
}
}
+ return VISU::Mesh::_nil();
}
ScalarMap_ptr VISU_Gen_i::ScalarMapOnField(Result_ptr theResult,
}
}
}
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch (...){
- INFOS("Unknown exception was accured!");
+ INFOS("Unknown exception was occured!");
}
return false;
}
if (!pStorable) {
return NULL;
}
- CORBA::String_var aTmpDir = SALOMEDS_Tool::GetTmpDir();
-
+
+ string aTmpDir = SALOMEDS_Tool::GetTmpDir();
+ string aCopyPersist = aTmpDir + "copy_persistent";
+
+ ofstream stmOut2(aCopyPersist.c_str(),ios::out);
string aStr = pStorable->ToString().c_str();
- ofstream stmOut2((string(aTmpDir) + string("copy_persistent")).c_str(),ios::out);
stmOut2<<aStr<<endl;
stmOut2.close();
if (Result_i* aResultObj = dynamic_cast<Result_i*>(aPOA->reference_to_servant(aCorbaObj))) {
string aFileName = string(SALOMEDS_Tool::GetNameFromPath(theObject->GetStudy()->URL())) + "_";
+ if(strlen(aFileName.c_str()) == 1) aFileName="";
const QFileInfo& aFileInfo = aResultObj->GetFileInfo();
aFileName += aFileInfo.fileName().latin1();
static QString aCommand;
+ string aFullFileName = aTmpDir + aFileName;
aCommand.sprintf("cp %s %s",
aFileInfo.filePath().latin1(),
- (string(aTmpDir) + aFileName).c_str());
+ aFullFileName.c_str());
if(system(aCommand) == -1) {
if(MYDEBUG) MESSAGE("VISU_Gen_i::Copy - Cann't execute the command :"<<aCommand);
return NULL;
}
-
aSeq->length(2);
aSeq[0] = "copy_persistent";
aSeq[1] = aFileName.c_str();
aSeq->length(1);
aSeq[0] = "copy_persistent";
}
- aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aSeq.in(), false);
- SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aSeq.in(), true);
+
+ aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.c_str(), aSeq.in(), false);
+ SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq.in(), true);
// Assign an ID = 1 the the type VISU::Result
theObjectID = 1;
SALOMEDS::SObject_var aResultSO;
if (theObjectID != 1)
return aResultSO._retn();
+
+ string aTmpDir = SALOMEDS_Tool::GetTmpDir();
+ SALOMEDS::ListOfFileNames_var aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.c_str(), false);
- CORBA::String_var aTmpDir = (const char*)SALOMEDS_Tool::GetTmpDir();
- SALOMEDS::ListOfFileNames_var aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir, false);
-
- ifstream stmIn((string(aTmpDir) + string("copy_persistent")).c_str());
+ ifstream stmIn((aTmpDir + string("copy_persistent")).c_str());
stmIn.seekg(0, ios::end);
int aLength = stmIn.tellg();
stmIn.seekg(0, ios::beg);
aString[aLength] = 0;
myIsMultiFile = false;
- string aFileName(aTmpDir.in());
- if(aSeq->length() > 1) aFileName += aSeq[1].in();
-
+ string aFileName(aTmpDir);
+ string aBasicFileName;
+ if(aSeq->length() > 1) {
+ aBasicFileName = aSeq[1].in();
+ aFileName += aBasicFileName;
+ }
+
SALOMEDS::SComponent_var aComponent = theObject->GetFatherComponent();
SALOMEDS::Study_var aStudy = theObject->GetStudy();
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
SALOMEDS::ListOfFileNames_var aSeqToRm = new SALOMEDS::ListOfFileNames;
aSeqToRm->length(1);
aSeqToRm[0] = "copy_persistent";
- SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aSeqToRm.in(), true);
+
+ SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeqToRm.in(), true);
anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeIOR");
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
return aResultSO._retn();
}
-};
+}
virtual Container_ptr CreateContainer();
virtual Animation_ptr CreateAnimation(View3D_ptr theView3d);
+ virtual void DeleteResult(Result_ptr theResult);
+ virtual void DeletePrs3d(Prs3d_ptr thePrs3d);
+
// inherited methods from SALOMEDS::Driver
virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
const char* theURL,
SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
CORBA::Long theObjectID,
SALOMEDS::SObject_ptr theObject);
- /*! SAN & VSR : Test QT_EVENT
- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- */
- virtual void CreateTestView();
- virtual void ShowTestObject();
- /*! SAN & VSR : Test QT_EVENT
- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- */
};
}
#endif
bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
MESSAGE("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
return aResult;
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!");
+ INFOS("Unknown exception was occured!");
}
return 0;
}
bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
INFOS("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
return aResult;
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!");
+ INFOS("Unknown exception was occured!");
}
return 0;
}
VISU::Storable* VISU::Mesh_i::Build(int theRestoring){
SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
aStudyBuilder->NewCommand(); // There is a transaction
- try{
+ //try{
if(myResult->GetInput() == NULL)
throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
if(!theRestoring){
CORBA::String_var aString = GetID();
anIOR->SetValue(aString);
}
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
- return NULL;
- }catch(...){
- INFOS("Unknown exception was accured!");
- return NULL;
- }
+ //}catch(std::exception& exc){
+ // INFOS("Follow exception was occured :\n"<<exc.what());
+ // return NULL;
+ //}catch(...){
+ // INFOS("Unknown exception was occured!");
+ // return NULL;
+ //}
aStudyBuilder->CommitCommand();
return this;
}
#include "VISU_Actor.h"
#include <vtkGeometryFilter.h>
+#include <vtkDataSetMapper.h>
using namespace VISU;
using namespace std;
if(myAddToStudy){
Handle(SALOME_InteractiveObject) anIO = theIO;
if(anIO.IsNull()){
- CORBA::String_var anEntry = mySObject->GetID();
- anIO = new SALOME_InteractiveObject(strdup(anEntry.in()),"VISU",strdup(GetName()));
+ anIO = new SALOME_InteractiveObject(mySObject->GetID(),"VISU",GetName());
}
theActor->setIO(anIO);
}
bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
MESSAGE("Result_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<float(aResult));
return aResult;
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!");
+ INFOS("Unknown exception was occured!");
}
return 0;
}
int aTimeStamp = aValFieldIter->first;
try{
myInput->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!!!");
+ INFOS("Unknown exception was occured!!!");
}
}
}
const string& aGroupName = aGroupMapIter->first;
try{
myInput->GetMeshOnGroup(aMeshName,aGroupName);
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!!!");
+ INFOS("Unknown exception was occured!!!");
}
}
//Import families
const string& aFamilyName = aFamilyMapIter->first;
try{
myInput->GetMeshOnEntity(aMeshName,anEntity,aFamilyName);
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!!!");
+ INFOS("Unknown exception was occured!!!");
}
}
//Import mesh on entity
try{
myInput->GetMeshOnEntity(aMeshName,anEntity);
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!!!");
+ INFOS("Unknown exception was occured!!!");
}
}
}
myIsDone = 1;
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!!!");
+ INFOS("Unknown exception was occured!!!");
}
return myIsDone;
}
QString aIsBuild = QAD_CONFIG->getSetting("Visu:BuildResult");
bool isBuildAll = aIsBuild.isEmpty()? 0 : aIsBuild.toInt();
if(isBuildAll) BuildAll();
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
return NULL;
}catch(...){
- INFOS("Unknown exception was accured!!!");
+ INFOS("Unknown exception was occured!!!");
return NULL;
}
aStudyBuilder->CommitCommand();
myInitFileName = myFileInfo.filePath().latin1();
myName = ::GenerateName(myFileInfo.fileName()).latin1();
if(GetSourceId() == eRestoredFile){
- auto_ptr<char> aTmpDir(SALOMEDS_Tool::GetTmpDir());
+ auto_ptr<char> aTmpDir((char*)SALOMEDS_Tool::GetTmpDir().c_str());
static QString aCommand;
aCommand.sprintf("cp %s %s",myFileInfo.absFilePath().latin1(),aTmpDir.get());
if(system(aCommand) == -1){
}
myInput = CreateConvertor(myFileInfo.absFilePath().latin1());
if(!myInput)
- throw std::runtime_error("Create - Cannot create a Convertor for this file!!!");
- return Build();
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ throw std::runtime_error("Create - Cannot create a Convertor for this file!!!"); return Build();
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!!!");
+ INFOS("Unknown exception was occured!!!");
}
return NULL;
}
myName = ::GenerateName("aResult").latin1();
VISU::Storable* aStorable = Build(theMedSObject);
return aStorable;
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!!!");
+ INFOS("Unknown exception was occured!!!");
}
return NULL;
}
myFileInfo.setFile(aCompDataType.c_str());
myInitFileName = aCompDataType;
myName = ::GenerateName("aResult").latin1();
- VISU::Storable* aStorable = Build();
+ CORBA::String_var anIOR = myStudyDocument->ConvertObjectToIOR(theField);
+ SALOMEDS::SObject_var aFieldSObject = myStudyDocument->FindObjectIOR(anIOR);
+ VISU::Storable* aStorable = Build(aFieldSObject);
return aStorable;
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!!!");
+ INFOS("Unknown exception was occured!!!");
}
return NULL;
}
if(aIsBuild.isEmpty()? 0 : aIsBuild.toInt())
BuildAll();
return this;
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!!!");
+ INFOS("Unknown exception was occured!!!");
}
return NULL;
}
TSourceId mySourceId;
TInput *myInput;
CORBA::Boolean myIsDone;
- string myName, myInitFileName;
+ std::string myName, myInitFileName;
QFileInfo myFileInfo;
protected:
virtual Storable* Create(SALOMEDS::SObject_ptr theMedSObject);
virtual Storable* Create(SALOME_MED::FIELD_ptr theField);
virtual Storable* Restore(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap, const string& thePrefix);
+ const Storable::TRestoringMap& theMap, const std::string& thePrefix);
static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
- const string& thePrefix, const Storable::TRestoringMap& theMap);
+ const std::string& thePrefix, const Storable::TRestoringMap& theMap);
virtual void ToStream(std::ostringstream& theStr);
virtual const char* GetComment() const;
- static const string myComment;
+ static const std::string myComment;
TInput* GetInput();
- const string& GetName() const { return myName;}
+ const std::string& GetName() const { return myName;}
const QFileInfo& GetFileInfo() const { return myFileInfo;}
const Result_i::TSourceId& GetSourceId() const { return mySourceId;}
SALOMEDS::SComponent_var mySComponent;
public:
- string GetRefFatherEntry();
- string GetEntry();
+ std::string GetRefFatherEntry();
+ std::string GetEntry();
const SALOMEDS::SObject_var& GetSObject() const;
const SALOMEDS::Study_var& GetStudyDocument() const;
const SALOMEDS::SComponent_var& GetSComponent() const;
#include "VISU_ScalarMapAct.h"
#include "QAD_Config.h"
+#include <vtkDataSetMapper.h>
+#include <vtkTextProperty.h>
+
using namespace VISU;
using namespace std;
MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
}
return aResult;
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!");
+ INFOS("Unknown exception was occured!");
}
return 0;
}
CreateAttributes(myStudy,anEntry.c_str(),aRefFatherEntry.c_str(),anIOR,myName.c_str(),"",aComment.latin1(),true);
mySObject = myStudy->FindObjectIOR(anIOR);
}
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
return NULL;
}catch(...){
- INFOS("Unknown exception was accured!");
+ INFOS("Unknown exception was occured!");
return NULL;
}
if(myAddToStudy) aStudyBuilder->CommitCommand();
#include "VISU_StreamLines_i.hh"
#include "VISU_Actor.h"
+#include <vtkDataSetMapper.h>
#include <vtkAppendFilter.h>
using namespace VISU;
bool aResult = VISU_StreamLinesPL::IsPossible(anOutput);
MESSAGE("StreamLines_i::IsPossible - aResult = "<<aResult);
return aResult;
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!");
+ INFOS("Unknown exception was occured!");
}
return 0;
}
VISU::Prs3d_i* aPrs3di = NULL;
vtkPointSet* aSource = NULL;
if(!thePrs3d->_is_nil())
- if(aPrs3di = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(thePrs3d).in())){
+ if((aPrs3di = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(thePrs3d).in()))){
for(int i = myAppendFilter->GetNumberOfInputs()-1; i >= 0; i--)
myAppendFilter->RemoveInput(myAppendFilter->GetInput(i));
myAppendFilter->AddInput(aPrs3di->GetPL()->GetMapper()->GetInput());
#include <strstream>
#include <qfileinfo.h>
+#include <qstring.h>
#include <qfile.h>
using namespace std;
anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
SALOMEDS::StringSeq_var rowTitles = anInt->GetRowTitles();
if ( rowTitles->length() > 0 && myHRow > 0 && myHRow <= anInt->GetNbRows() ) {
- title = strdup( rowTitles[ myHRow-1 ] );
+ title = rowTitles[ myHRow-1 ];
}
}
else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
SALOMEDS::StringSeq_var rowTitles = aReal->GetRowTitles();
if ( rowTitles->length() > 0 && myHRow > 0 && myHRow <= aReal->GetNbRows() ) {
- title = strdup( rowTitles[ myHRow-1 ] );
+ title = rowTitles[ myHRow-1 ];
}
}
}
anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
SALOMEDS::StringSeq_var rowTitles = anInt->GetRowTitles();
if ( rowTitles->length() > 0 && myVRow > 0 && myVRow <= anInt->GetNbRows() )
- title = strdup( rowTitles[ myVRow-1 ] );
+ title = rowTitles[ myVRow-1 ];
}
else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
SALOMEDS::StringSeq_var rowTitles = aReal->GetRowTitles();
if ( rowTitles->length() > 0 && myVRow > 0 && myVRow <= aReal->GetNbRows() )
- title = strdup( rowTitles[ myVRow-1 ] );
+ title = rowTitles[ myVRow-1 ];
}
}
return title;
anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
SALOMEDS::StringSeq_var rowUnits = anInt->GetRowUnits();
if ( rowUnits->length() > 0 && myHRow > 0 && myHRow <= anInt->GetNbRows() )
- units = strdup( rowUnits[ myHRow-1 ] );
+ units = rowUnits[ myHRow-1 ];
}
else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
SALOMEDS::StringSeq_var rowUnits = aReal->GetRowUnits();
if ( rowUnits->length() > 0 && myHRow > 0 && myHRow <= aReal->GetNbRows() )
- units = strdup( rowUnits[ myHRow-1 ] );
+ units = rowUnits[ myHRow-1 ];
}
}
return units;
anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
SALOMEDS::StringSeq_var rowUnits = anInt->GetRowUnits();
if ( rowUnits->length() > 0 && myVRow > 0 && myVRow <= anInt->GetNbRows() )
- units = strdup( rowUnits[ myVRow-1] );
+ units = rowUnits[ myVRow-1];
}
else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
SALOMEDS::StringSeq_var rowUnits = aReal->GetRowUnits();
if ( rowUnits->length() > 0 && myVRow > 0 && myVRow <= aReal->GetNbRows() )
- units = strdup( rowUnits[ myVRow-1 ] );
+ units = rowUnits[ myVRow-1 ];
}
}
return units;
SALOMEDS::Color color = GetColor();
crv->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
crv->setAutoAssign( IsAuto() );
- crv->setIO(new SALOME_InteractiveObject(strdup(mySObj->GetID()),"VISU",strdup(GetName())));
+ crv->setIO(new SALOME_InteractiveObject(mySObj->GetID(),"VISU",GetName()));
if ( myTable )
- crv->setTableIO(new SALOME_InteractiveObject(strdup(myTable->GetObjectEntry()),"VISU",strdup(myTable->GetName())));
+ crv->setTableIO(new SALOME_InteractiveObject(myTable->GetObjectEntry(),"VISU",myTable->GetName()));
return crv;
}
/*!
Gets reference table's entry
*/
const char* VISU::Curve_i::GetTableID() {
- return CORBA::string_dup(myTable->GetObjectEntry());
+ return myTable->GetObjectEntry();
}
/*!
Called from engine to restore curve from the file
//-------------------------------------------------------------
// Implementation of reading from file
//-------------------------------------------------------------
-typedef double TValue;
+typedef string TValue;
typedef vector<TValue> TValues;
struct TRow{
void ImportTables(const char* theFileName, TTableCont& theTableCont){
static int STRPRECISION = 12;
ifstream aStmIn;
- QFileInfo aFileInfo(theFileName);
- if(!aFileInfo.isFile() || !aFileInfo.isReadable() || !aFileInfo.size()) return;
- aStmIn.open(theFileName);
+ QFileInfo aFileInfo( theFileName );
+ if( !aFileInfo.isFile() || !aFileInfo.isReadable() || !aFileInfo.size() )
+ return;
+ aStmIn.open( theFileName );
QString aTmp;
- do{
- //Find beginning of Table
- while(getLine(aStmIn,aTmp) && aTmp == "\n");
- if(MYDEBUG) cout<<"\n There is new Table2D with Title = ";
+ do {
+ // find beginning of table (tables are separated by empty lines)
+ while( getLine( aStmIn, aTmp ) && aTmp.stripWhiteSpace() == "");
TTable2D aTable2D;
- while(!aStmIn.eof() && aTmp != "\n"){
- if(aTmp.find("#TITLE:") == 0){
- int aLen = aTmp.find(":") + 1;
- aTmp.remove(0,aLen);
- QString aTitle = aTmp.stripWhiteSpace();
- aTable2D.myTitle = aTitle.latin1();
- if(MYDEBUG) cout<<aTitle<<endl;
- }else if(aTmp.find("#COLUMN_TITLES:") == 0){
- int aLen = aTmp.find(":") + 1;
- aTmp.remove(0,aLen);
- QStringList aStrList = QStringList::split("|",aTmp);
- if(MYDEBUG) cout<<"Its Column Titles : ";
- for(int i = 0; i < aStrList.count(); i++){
- aTmp = aStrList[i].stripWhiteSpace();
- aTable2D.myColumnTitles.push_back(aTmp.latin1());
- if(MYDEBUG) cout<<"\t"<<aTmp;
+ if(MYDEBUG) cout << "New table is found" << endl;
+ while( !aStmIn.eof() && aTmp.stripWhiteSpace() != "" ){
+ QString data = aTmp.stripWhiteSpace();
+ QString cmt = "";
+ QString keyword = "";
+ // split string to data and comment (comment starts from '#' symbol)
+ int index = aTmp.find( "#" );
+ if ( index >= 0 ) {
+ data = aTmp.left( index ).stripWhiteSpace();
+ cmt = aTmp.mid( index+1 ).stripWhiteSpace();
+ }
+ // if comment is not empty, try to get keyword from it (separated by ':' symbol)
+ if ( !cmt.isEmpty() ) {
+ int index1 = cmt.find( ":" );
+ if ( index1 >= 0 ) {
+ QString tmpstr = cmt.left( index1 ).stripWhiteSpace();
+ if ( tmpstr == QString( "TITLE" ) ||
+ tmpstr == QString( "COLUMN_TITLES" ) ||
+ tmpstr == QString( "COLUMN_UNITS" ) ||
+ tmpstr == QString( "COMMENT" ) ) {
+ keyword = tmpstr;
+ cmt = cmt.mid( index1+1 ).stripWhiteSpace();
+ }
+ }
+ }
+ // if data is empty, process only comment
+ if ( data.isEmpty() ) {
+ // if keyword is found, try to process it
+ // elsewise it is a simple comment, just ignore it
+ if ( !keyword.isEmpty() ) {
+ if ( keyword == QString( "TITLE" ) ) {
+ QString title = cmt;
+ if ( aTable2D.myTitle != "" )
+ title = QString( aTable2D.myTitle.c_str() ) + QString( " " ) + title;
+ if(MYDEBUG) cout << "...Table TITLE is: " << title.latin1() << endl;
+ aTable2D.myTitle = title.latin1();
+ }
+ else if ( keyword == QString( "COLUMN_TITLES" ) ) {
+ // comment may contain column headers
+ QStringList aStrList = QStringList::split( "|", cmt );
+ if(MYDEBUG) cout << "...Column TITLES are: ";
+ for ( int i = 0; i < aStrList.count(); i++ ) {
+ QString tmpstr = aStrList[ i ].stripWhiteSpace();
+ if(MYDEBUG) cout << tmpstr.latin1() << " ";
+ aTable2D.myColumnTitles.push_back( tmpstr.latin1() );
+ }
+ if(MYDEBUG) cout << endl;
+ }
+ else if ( keyword == QString( "COLUMN_UNITS" ) ) {
+ // comment may contain column units
+ QStringList aStrList = QStringList::split( " ", cmt );
+ if(MYDEBUG) cout << "...Column UNITS are: ";
+ for ( int i = 0; i < aStrList.count(); i++ ) {
+ QString tmpstr = aStrList[ i ].stripWhiteSpace();
+ if(MYDEBUG) cout << tmpstr.latin1() << " ";
+ aTable2D.myColumnUnits.push_back( tmpstr.latin1() );
+ }
+ if(MYDEBUG) cout << endl;
+ }
+ else if ( keyword == QString( "COMMENT" ) ) {
+ // keyword 'COMMENT' processing can be here
+ // currently it is ignored
+ if(MYDEBUG) cout << "...COMMENT: " << cmt.latin1() << endl;
+ }
}
- if(MYDEBUG) cout<<endl;
- }else if(aTmp.find("#COLUMN_UNITS:") == 0){
- int aLen = aTmp.find(":") + 1;
- aTmp.remove(0,aLen);
- QStringList aStrList = QStringList::split(" ",aTmp);
- if(MYDEBUG) cout<<"Its Column Units : ";
- for(int i = 0; i < aStrList.count(); i++){
- aTmp = aStrList[i].stripWhiteSpace();
- aTable2D.myColumnUnits.push_back(aTmp.latin1());
- if(MYDEBUG) cout<<"\t"<<aTmp;
+ else {
+ if(MYDEBUG) cout << "...comment: " << cmt.latin1() << endl;
+ // simple comment processing can be here
+ // currently it is ignored
}
- if(MYDEBUG) cout<<endl;
- }else if(aTmp.find("#") == 0){
- //It is a comment
- }else if(aTmp.find("#TITLE:") > 0){
- QStringList aStrList = QStringList::split("#TITLE:",aTmp);
- QString aTitle = aStrList[1].stripWhiteSpace();
+ }
+ // if data is not empty, try to process it
+ else {
TRow aRow;
- aRow.myTitle = aTitle.latin1();
- if(MYDEBUG) cout<<aTitle<<" : ";
- QStringList aValList = QStringList::split(" ",aStrList[0]);
- for(int i = 0; i < aValList.count(); i++){
- float aVal = aValList[i].toFloat();
- aRow.myValues.push_back(aVal);
- if(MYDEBUG) cout<<"\t"<<aVal;
+ if(MYDEBUG) cout << "...New row is found: " << endl;
+ if ( !cmt.isEmpty() ) {
+ aRow.myTitle = cmt.latin1();
+ if(MYDEBUG) cout << "......ROW TITLE is: " << cmt.latin1() << endl;
+ }
+ QStringList aValList = QStringList::split( " ", data );
+ for ( int i = 0; i < aValList.count(); i++ ) {
+ if ( aValList[i].stripWhiteSpace() != "" ) {
+ TValue aVal = aValList[i].stripWhiteSpace().latin1();
+ aRow.myValues.push_back( aVal );
+ }
}
- aTable2D.myRows.push_back(aRow);
- if(MYDEBUG) cout<<endl;
- }else{
- TRow aRow;
+ if( aRow.myValues.size() > 0 )
+ aTable2D.myRows.push_back( aRow );
+ // ************** OLD CODE ******************
+ /*
TValue aVal;
- istrstream aStream(aTmp);
- aStream.precision(STRPRECISION);
- while(aStream>>aVal){
- aRow.myValues.push_back(aVal);
- if(MYDEBUG) cout<<"\t"<<aVal;
+ istrstream aStream( data );
+ aStream.precision( STRPRECISION );
+ while( aStream >> aVal ) {
+ aRow.myValues.push_back( aVal );
}
- if(aRow.myValues.size() > 0)
- aTable2D.myRows.push_back(aRow);
- if(MYDEBUG) cout<<endl;
+ if( aRow.myValues.size() > 0 )
+ aTable2D.myRows.push_back( aRow );
+ */
+ // ************** OLD CODE ******************
}
- getLine(aStmIn,aTmp);
+ getLine( aStmIn, aTmp );
}
- if(aTable2D.Check()){
- if(MYDEBUG) cout<<"aTable2D checked "<<aTable2D.myTitle<<endl;
- theTableCont.push_back(aTable2D);
+ if( aTable2D.Check() ) {
+ if(MYDEBUG) cout << "aTable2D is checked OK " << aTable2D.myTitle << endl;
+ theTableCont.push_back( aTable2D );
}
- }while(!aStmIn.eof());
+ }
+ while( !aStmIn.eof() );
aStmIn.close();
- if(MYDEBUG) cout<<"After close"<<endl;
+ if(MYDEBUG) cout << "After close" << endl;
}
SALOMEDS::SObject_var VISU::ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy){
int kEnd = aNewTable2D.myRows[0].myValues.size();
aTableOfReal->SetNbColumns(kEnd);
for(int j = 0, jEnd = aNewTable2D.myRows.size(); j < jEnd; j++){
- if(MYDEBUG) cout<<"j = "<<j<<endl;
- SALOMEDS::DoubleSeq_var aDoubleSeq = new SALOMEDS::DoubleSeq();
- aDoubleSeq->length(kEnd);
- if(MYDEBUG) cout<<"kEnd = "<<kEnd<<endl;
- for(int k = 0; k < kEnd; k++) aDoubleSeq[k] = aNewTable2D.myRows[j].myValues[k];
- aTableOfReal->AddRow(aDoubleSeq.in());
+ if(MYDEBUG) cout<<"j = "<<j<<"; kEnd = "<<kEnd<<endl;
+
+ for(int k = 0; k < kEnd; k++){
+ QString aVal = aNewTable2D.myRows[j].myValues[k].c_str();
+ bool anIsOk = false;
+ double aValue = aVal.toDouble(&anIsOk);
+ if(anIsOk && !aVal.contains("NAN",false) && !aVal.contains("INF",false))
+ aTableOfReal->PutValue(aValue,j+1,k+1);
+ }
+
aTableOfReal->SetRowTitle(j+1,aNewTable2D.myRows[j].myTitle.c_str());
aTableOfReal->SetRowUnit(j+1,aNewTable2D.myRows[j].myUnit.c_str());
}
vtkRenderer* aRen = myView->getRenderer();
if (!theData.myActors.empty()) {
for (int i = 0, iEnd = theData.myActors.size(); i < iEnd; i++) {
- //_CS_PhB if (theData.myActors.at(i) != 0) {
- //_CS_PhB theData.myActors.at(i)->RemoveFromRender(aRen);
- //_CS_PhB theData.myActors.at(i)->Delete();
- //_CS_PhB }
if (theData.myActors[i] != 0) {
theData.myActors[i]->RemoveFromRender(aRen);
theData.myActors[i]->Delete();
}
if (!theData.myPrs.empty()) {
for (int i = 0, iEnd = theData.myPrs.size(); i < iEnd; i++)
- //_CS_PhB if (theData.myPrs.at(i) != 0) {
- //_CS_PhB theData.myPrs.at(i)->_remove_ref();
- //_CS_PhB }
if (theData.myPrs[i] != 0) {
theData.myPrs[i]->_remove_ref();
}
aTimeStamp = anIter->Value();
if (aTimeStamp->_is_nil()) continue;
- //_CS_PhB aData.myTiming.at(i) = getTimeValue(aTimeStamp);
- //_CS_PhB if (isRangeDefined()) {
- //_CS_PhB if (aData.myTiming.at(i) < myMinVal) continue;
- //_CS_PhB if (aData.myTiming.at(i) > myMaxVal) break;
- //_CS_PhB }
aData.myTiming[i] = getTimeValue(aTimeStamp);
if (isRangeDefined()) {
if (aData.myTiming[i] < myMinVal) continue;
aFieldName.latin1(), aTimeStampId);
//VISU::ScalarMap_var aTmp = aPresent->_this();
//aPresent->_remove_ref();
- //_CS_PhB aData.myPrs.at(i) = aPresent;
aData.myPrs[i] = aPresent;
}
break;
aFieldName.latin1(), aTimeStampId);
//VISU::IsoSurfaces_var aTmp = aPresent->_this();
//aPresent->_remove_ref();
- //_CS_PhB aData.myPrs.at(i) = aPresent;
aData.myPrs[i] = aPresent;
}
break;
aFieldName.latin1(), aTimeStampId);
//VISU::CutPlanes_var aTmp = aPresent->_this();
//aPresent->_remove_ref();
- //_CS_PhB aData.myPrs.at(i) = aPresent;
aData.myPrs[i] = aPresent;
}
break;
aFieldName.latin1(), aTimeStampId);
//VISU::DeformedShape_var aTmp = aPresent->_this();
//aPresent->_remove_ref();
- //_CS_PhB aData.myPrs.at(i) = aPresent;
aData.myPrs[i] = aPresent;
}
break;
aFieldName.latin1(), aTimeStampId);
//VISU::Vectors_var aTmp = aPresent->_this();
//aPresent->_remove_ref();
- //_CS_PhB aData.myPrs.at(i) = aPresent;
aData.myPrs[i] = aPresent;
}
break;
aFieldName.latin1(), aTimeStampId);
//VISU::StreamLines_var aTmp = aPresent->_this();
//aPresent->_remove_ref();
- //_CS_PhB aData.myPrs.at(i) = aPresent;
aData.myPrs[i] = aPresent;
}
break;
}
- //_CS_PhB if (aData.myPrs.at(i)->GetMin() < aMin) aMin = aData.myPrs.at(i)->GetMin();
- //_CS_PhB if (aData.myPrs.at(i)->GetMax() > aMax) aMax = aData.myPrs.at(i)->GetMax();
if (aData.myPrs[i]->GetMin() < aMin) aMin = aData.myPrs[i]->GetMin();
if (aData.myPrs[i]->GetMax() > aMax) aMax = aData.myPrs[i]->GetMax();
i++;
QString aFixRange = QAD_CONFIG->getSetting("Visu:SBImposeRange");
if (aFixRange.compare("true") != 0) {
for (i = 0; i < aData.myNbFrames; i++)
- //_CS_PhB aData.myPrs.at(i)->SetRange(aMin, aMax);
aData.myPrs[i]->SetRange(aMin, aMax);
if(aData.myPrsType == VISU::TISOSURFACE)
for (i = 0; i < aData.myNbFrames; i++)
- //_CS_PhB if(VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aData.myPrs.at(i)))
if(VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aData.myPrs[i]))
aPrs->SetSubRange(aMin, aMax);
}
for (long j = 0; j < aData.myNbFrames; j++) {
VISU_Actor* aActor = NULL;
try{
- //_CS_PhB aActor = aData.myPrs.at(j)->CreateActor();
aActor = aData.myPrs[j]->CreateActor();
myView->AddActor(aActor);
if(j == 0)
aActor->VisibilityOff();
}catch(...){ //catch(std::runtime_error& exc){
aNoError = false;
- //_CS_PhB myLastError += QString("%1 ").arg(aData.myTiming.at(j));
myLastError += QString("%1 ").arg(aData.myTiming[j]);
}
- //_CS_PhB aData.myActors.at(j) = aActor;
aData.myActors[j] = aActor;
}
}
myFrame = 0;
- myLastError += QString(" timestamp(s) cannot /local/salome/SALOME2/VISU/V1_4_1a/VISU_SRC/src/VISU_I/VISU_TimeAnimation.cxxbe created.");
- //_CS_PhB emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
+ myLastError += QString(" timestamp(s) cannot be created.");
emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
myView->Repaint();
return aNoError;
MESSAGE("Viewer is nod defined for animation");
return;
}
- //_CS_PhB : "mt" ne sert pas dans cette methode VISU::Mutex mt(myMutex,qApp,MYDELAY);
vtkRenderer* aRen = myView->getRenderer();
for (int i = 0; i < getNbFields(); i++) {
FieldData& aData = myFieldsLst[i];
if (!aData.myActors.empty()) {
for (int i = 0, iEnd = aData.myActors.size(); i < iEnd; i++) {
-//_CS_PhB if (aData.myActors.at(i) != 0) {
-//_CS_PhB aData.myActors.at(i)->RemoveFromRender(aRen);
-//_CS_PhB aData.myActors.at(i)->Delete();
-//_CS_PhB }
if (aData.myActors[i] != 0) {
aData.myActors[i]->RemoveFromRender(aRen);
aData.myActors[i]->Delete();
aData.myActors.clear();
}
}
- myView->getRW()->getRenderWindow()->Render();
+ VISU::RepaintView(myView);
//myView->update();
}
if (myFrame < (myFieldsLst[0].myNbFrames-1)) {
int i;
for (i = 0; i < getNbFields(); i++)
-
-//_CS_PhB if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
if (myFieldsLst[i].myActors[myFrame] != 0)
myFieldsLst[i].myActors[myFrame]->VisibilityOff();
+
myFrame++;
for (i = 0; i < getNbFields(); i++)
-//_CS_PhB if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();
if (myFieldsLst[i].myActors[myFrame] != 0)
myFieldsLst[i].myActors[myFrame]->VisibilityOn();
-//_CS_PhB emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
myView->Repaint();
}
if (myFrame > 0) {
int i;
for (i = 0; i < getNbFields(); i++)
- //_CS_PhB if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
if (myFieldsLst[i].myActors[myFrame] != 0)
myFieldsLst[i].myActors[myFrame]->VisibilityOff();
myFrame--;
for (i = 0; i < getNbFields(); i++)
- //_CS_PhB if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();
if (myFieldsLst[i].myActors[myFrame] != 0)
myFieldsLst[i].myActors[myFrame]->VisibilityOn();
- //_CS_PhB emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
myView->Repaint();
}
int i;
for (i = 0; i < getNbFields(); i++)
if(!myFieldsLst[i].myActors.empty())
- //_CS_PhB if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
if (myFieldsLst[i].myActors[myFrame] != 0)
myFieldsLst[i].myActors[myFrame]->VisibilityOff();
myFrame = 0;
for (i = 0; i < getNbFields(); i++)
if(!myFieldsLst[i].myActors.empty())
- //_CS_PhB if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();
if (myFieldsLst[i].myActors[myFrame] != 0)
myFieldsLst[i].myActors[myFrame]->VisibilityOn();
if(!myFieldsLst[0].myTiming.empty()){
- //_CS_PhB emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
myView->Repaint();
}
stopAnimation();
int i;
for (i = 0; i < getNbFields(); i++)
- //_CS_PhB if (myFieldsLst[i].myActors.at(myFrame) != 0)
- //_CS_PhB myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
if (myFieldsLst[i].myActors[myFrame] != 0)
myFieldsLst[i].myActors[myFrame]->VisibilityOff();
+
myFrame = myFieldsLst[0].myNbFrames-1;
for (i = 0; i < getNbFields(); i++)
-//_CS_PhB if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();
if (myFieldsLst[i].myActors[myFrame] != 0)
myFieldsLst[i].myActors[myFrame]->VisibilityOn();
-//_CS_PhB emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
myView->Repaint();
}
qApp->syncX();
int i;
for (i = 0; i < getNbFields(); i++)
-//_CS_PhB if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
if (myFieldsLst[i].myActors[myFrame] != 0)
myFieldsLst[i].myActors[myFrame]->VisibilityOff();
myFrame = theFrame;
for (i = 0; i < getNbFields(); i++)
-//_CS_PhB if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();
if (myFieldsLst[i].myActors[myFrame] != 0)
myFieldsLst[i].myActors[myFrame]->VisibilityOn();
-//_CS_PhB emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
myView->Repaint();
qApp->flushX();
return VISU::ScalarMap::_nil();
if ((theFrame < 0) || (theFrame > (myFieldsLst[theField].myNbFrames - 1)))
return VISU::ScalarMap::_nil();
-//_CS_PhB return myFieldsLst[theField].myPrs.at(theFrame)->_this();
return myFieldsLst[theField].myPrs[theFrame]->_this();
}
double aOneVal;
bool isDumping = !myDumpPath.isEmpty();
aOneVal = (myFieldsLst[0].myNbFrames > 2) ?
- //_CS_PhB myFieldsLst[0].myTiming.at(1) - myFieldsLst[0].myTiming.at(0) : 1;
myFieldsLst[0].myTiming[1] - myFieldsLst[0].myTiming[0] : 1;
qApp->lock();
while (myIsActive) {
- //_CS_PhB emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
for (int i = 0; i < getNbFields(); i++) {
FieldData& aData = myFieldsLst[i];
if (myFrame > 0) {
-//_CS_PhB if (aData.myActors.at(myFrame-1) != 0)
-//_CS_PhB aData.myActors.at(myFrame-1)->VisibilityOff();
if (aData.myActors[myFrame-1] != 0)
aData.myActors[myFrame-1]->VisibilityOff();
} else {
-//_CS_PhB if (aData.myActors.at(aData.myNbFrames-1) != 0)
-//_CS_PhB aData.myActors.at(aData.myNbFrames-1)->VisibilityOff();
if (aData.myActors[aData.myNbFrames-1] != 0)
aData.myActors[aData.myNbFrames-1]->VisibilityOff();
}
-//_CS_PhB if (aData.myActors.at(myFrame) != 0) {
-//_CS_PhB aData.myActors.at(myFrame)->VisibilityOn();
if (aData.myActors[myFrame] != 0) {
aData.myActors[myFrame]->VisibilityOn();
}
if (isDumping) {
QPixmap px = QPixmap::grabWindow(myView->getViewWidget()->winId());
QString aFile(myDumpPath);
-//_CS_PhB QString aName = QString("%1").arg(myFieldsLst[0].myTiming.at(myFrame));
QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
int aPos = -1;
while ((aPos = aName.find(".")) > -1 )
aFile += aName;
aFile += ".jpeg";
px.save(aFile, "JPEG");
- }//_CS_PhB
+ }
if (!isDumping) {
if (myProportional) {
switch (myFrame) {
break;
case 1:
if (myFieldsLst[0].myNbFrames > 2)
-//_CS_PhB k = (myFieldsLst[0].myTiming.at(myFrame+1) - myFieldsLst[0].myTiming.at(myFrame))/aOneVal;
k = (myFieldsLst[0].myTiming[myFrame+1] - myFieldsLst[0].myTiming[myFrame])/aOneVal;
else
k = 1;
break;
default:
k = (myFrame < (myFieldsLst[0].myNbFrames-1))?
-//_CS_PhB (myFieldsLst[0].myTiming.at(myFrame+1) - myFieldsLst[0].myTiming.at(myFrame))/aOneVal : 1;
(myFieldsLst[0].myTiming[myFrame+1] - myFieldsLst[0].myTiming[myFrame])/aOneVal : 1;
}
} else
QString aNameString(aName->Value());
return aNameString.toDouble();
}
+ return -1.0;
}
//************************************************************************
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
MESSAGE("Vectors_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
}
- }catch(std::runtime_error& exc){
- INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was accured!");
+ INFOS("Unknown exception was occured!");
}
return aResult;
}
#include "VISU_PrsObject_i.hh"
#include "VISU_Result_i.hh"
+#include "VISU_Gen_i.hh"
#include "VISU_Prs3d_i.hh"
#include "VISU_Mesh_i.hh"
#include "QAD_Desktop.h"
#include "QAD_Tools.h"
#include "QAD_Study.h"
+#include "QAD_LeftFrame.h"
#include "QAD_RightFrame.h"
#include "QAD_StudyFrame.h"
+#include "QAD_PyEditor.h"
#include "VTKViewer_ViewFrame.h"
+#include "VTKViewer_RenderWindow.h"
#include "SALOMEGUI_TableDlg.h"
#include "Plot2d_CurveContainer.h"
#include "Plot2d_ViewFrame.h"
#include <qstring.h>
#include <qfileinfo.h>
-#include <vtkTransformPolyDataFilter.h>
-#include <vtkDataSetMapper.h>
#include <vtkRenderer.h>
#include <vtkCamera.h>
#endif
static QFileInfo aFileInfo;
-static int MYDELAY = 1;
namespace VISU{
//===========================================================================
}
};
+ class TSetViewRepresentation: public SALOME_Event{
+ VISU::View::ViewRepresentation myViewRepr;
+ View_i* myView;
+ CORBA::Boolean myState;
+ public:
+ TSetViewRepresentation( View_i* aView,
+ VISU::View::ViewRepresentation ViewRepr,
+ CORBA::Boolean State ):
+ SALOME_Event(), myViewRepr( ViewRepr ), myView( aView ), myState( State )
+ {}
+ virtual void Execute(){
+
+ bool old = myView->IsPartShown( myViewRepr );
+
+ QAD_RightFrame* fr = myView->myStudyFrame->getRightFrame();
+
+ if( myView->myStudyFrame != NULL ){
+ switch( myViewRepr )
+ {
+ case VISU::View::OBJECTBROWSER:
+ if( myState!=old )
+ if( myState )
+ myView->myStudyFrame->unCompressLeft();
+ else
+ myView->myStudyFrame->compressLeft();
+ break;
+ case VISU::View::VIEWER:
+ if( myState!=old )
+ if( myState )
+ fr->unCompressUp();
+ else
+ fr->compressUp();
+ break;
+ case VISU::View::PYTHON:
+ if( myState!=old )
+ if( myState )
+ fr->unCompressLeft();
+ else
+ fr->compressLeft();
+ break;
+ case VISU::View::MESSAGES:
+ if( myState!=old )
+ if( myState )
+ fr->unCompressRight();
+ else
+ fr->compressRight();
+ break;
+ };
+ }
+ }
+};
+
+ class TGetViewRepresentation: public SALOME_Event
+ {
+ public:
+ typedef CORBA::Boolean TResult;
+ TResult myResult;
+ VISU::View::ViewRepresentation myPart;
+ View_i* myView;
+
+ TGetViewRepresentation( View_i* aView, VISU::View::ViewRepresentation Part ):
+ SALOME_Event(), myResult( false ), myPart( Part ), myView( aView )
+ {
+ }
+ virtual void Execute(){
+ switch( myPart )
+ {
+ case VISU::View::OBJECTBROWSER:
+ myResult = !myView->myStudyFrame->isCompressedLeft();
+ break;
+ case VISU::View::VIEWER:
+ myResult = !myView->myStudyFrame->getRightFrame()->isCompressedViewFrame();
+ break;
+ case VISU::View::PYTHON:
+ myResult = !myView->myStudyFrame->getRightFrame()->isCompressedPython();
+ break;
+ case VISU::View::MESSAGES:
+ myResult = !myView->myStudyFrame->getRightFrame()->isCompressedMessage();
+ }
+ }
+ };
+
+ class TSetViewWidthHeight: public SALOME_Event{
+ CORBA::Long mySize;
+ bool myIsWidth;
+ View_i* myView;
+ public:
+ TSetViewWidthHeight( View_i* aView, CORBA::Long Size, bool IsWidth ):
+ SALOME_Event(), mySize( Size ), myView( aView ), myIsWidth( IsWidth )
+ {}
+ virtual void Execute(){
+ if( myView->myStudyFrame != NULL ){
+ QWidget* aStudyParent = myView->myStudyFrame->parentWidget(true);
+ int aleft = aStudyParent->frameGeometry().left();
+ int atop = aStudyParent->frameGeometry().top();
+ int aheight = aStudyParent->frameGeometry().height();
+ int awidth = aStudyParent->frameGeometry().width();
+ QRect aQRect;
+ if( myIsWidth )
+ aQRect = QRect( aleft, atop, mySize, aheight );
+ else
+ aQRect = QRect( aleft, atop, awidth, mySize );
+
+ aStudyParent->setGeometry(aQRect);
+ }
+ }
+ };
+
+ class TGetViewWidthHeight: public SALOME_Event{
+ public:
+ typedef CORBA::Long TResult;
+ TResult myResult;
+ bool myIsWidth;
+ View_i* myView;
+ public:
+ TGetViewWidthHeight( View_i* aView, bool IsWidth ):
+ SALOME_Event(), myView( aView ), myIsWidth( IsWidth )
+ {}
+
+ virtual void Execute()
+ {
+ if( myView ) {
+ QWidget* aStudyParent = myView->myStudyFrame->parentWidget(true);
+ if( myIsWidth )
+ myResult = aStudyParent->frameGeometry().width();
+ else
+ myResult = aStudyParent->frameGeometry().height();
+ }
+ }
+ };
+
+ class TSetViewPositionHorizontal: public SALOME_Event{
+ VISU::View::ViewPosition myViewPos;
+ View_i* myView;
+ public:
+ TSetViewPositionHorizontal ( View_i* aView,
+ VISU::View::ViewPosition ViewPos ):
+ SALOME_Event(), myView( aView ), myViewPos(ViewPos)
+ {}
+ virtual void Execute(){
+ QWidget* aWorkspace = dynamic_cast <QWidget*> (myView->myStudy->getApp()->getDesktop()->getMainFrame());
+ QWidget* aStudy = dynamic_cast <QWidget*> (myView->myStudyFrame);
+ QWidget* aStudyParent = aStudy->parentWidget(true);
+ if ( aStudyParent != 0 )
+ if ( aWorkspace!=NULL || aStudy != NULL )
+ switch(myViewPos){
+ case VISU::View::LEFT:
+ QAD_Tools::alignWidget(aStudyParent,aWorkspace,Qt::AlignLeft);
+ break;
+ case VISU::View::CENTER:
+ QAD_Tools::alignWidget(aStudyParent,aWorkspace,Qt::AlignHCenter);
+ break;
+ case VISU::View::RIGHT:
+ QAD_Tools::alignWidget(aStudyParent,aWorkspace,Qt::AlignRight);
+ break;
+ }
+ }
+ };
+
+ class TSetViewPositionVertical: public SALOME_Event{
+ VISU::View::ViewPosition myViewPos;
+ View_i* myView;
+ public:
+ TSetViewPositionVertical ( View_i* aView,
+ VISU::View::ViewPosition ViewPos ):
+ SALOME_Event(), myView( aView ), myViewPos(ViewPos)
+ {}
+ virtual void Execute(){
+ QWidget* aWorkspace = dynamic_cast <QWidget*> (myView->myStudy->getApp()->getDesktop()->getMainFrame());
+ QWidget* aStudy = dynamic_cast <QWidget*>(myView->myStudyFrame);
+ QWidget* aStudyParent = aStudy->parentWidget(true);
+ if ( aStudyParent != 0 )
+ if ( aWorkspace!=NULL || aStudy != NULL )
+ switch(myViewPos){
+ case VISU::View::TOP:
+ QAD_Tools::alignWidget(aStudyParent,aWorkspace,Qt::AlignTop);
+ break;
+ case VISU::View::CENTER:
+ QAD_Tools::alignWidget(aStudyParent,aWorkspace,Qt::AlignVCenter);
+ break;
+ case VISU::View::BOTTOM:
+ QAD_Tools::alignWidget(aStudyParent,aWorkspace,Qt::AlignBottom);
+ break;
+ }
+ }
+ };
+
+ class TSetRelativePosition : public SALOME_Event
+ {
+ View_i* myView;
+ CORBA::Double myX, myY;
+ public:
+ TSetRelativePosition ( View_i* aView, CORBA::Double X, CORBA::Double Y ):
+ SALOME_Event(), myView( aView ), myX( X ), myY( Y )
+ {}
+ virtual void Execute(){
+ QWidget* aWorkspace = dynamic_cast <QWidget*> (myView->myStudy->getApp()->getDesktop()->getMainFrame());
+ if( aWorkspace )
+ {
+ QAD_StudyFrame* aFrame = myView->myStudyFrame;
+ QWidget* aStudyParent = aFrame->parentWidget(true);
+ aStudyParent->move( int( myX * aWorkspace->width() ), int( myY * aWorkspace->height() ) );
+ }
+ }
+ };
+
+ class TSetRelativeSize : public SALOME_Event
+ {
+ View_i* myView;
+ CORBA::Double myX, myY;
+ public:
+ TSetRelativeSize ( View_i* aView, CORBA::Double X, CORBA::Double Y ):
+ SALOME_Event(), myView( aView ), myX( X ), myY( Y )
+ {}
+ virtual void Execute(){
+ QWidget* aWorkspace = dynamic_cast <QWidget*> (myView->myStudy->getApp()->getDesktop()->getMainFrame());
+ if( aWorkspace )
+ {
+ QAD_StudyFrame* aFrame = myView->myStudyFrame;
+ QWidget* aStudyParent = aFrame->parentWidget(true);
+ aStudyParent->setGeometry( aStudyParent->x(), aStudyParent->y(),
+ int( myX * aWorkspace->width() ), int( myY * aWorkspace->height() ) );
+ }
+ }
+ };
+
+
class TSavePictureEvent: public SALOME_Event{
QWidget* myWidget;
}
- void RepaintView(QAD_StudyFrame* theStudyFrame){
- GetRenderer(theStudyFrame)->ResetCameraClippingRange();
- GetViewFrame(theStudyFrame)->getRW()->getRenderWindow()->Render();
+ void RepaintView(VTKViewer_ViewFrame* theViewFrame){
+ theViewFrame->getRenderer()->ResetCameraClippingRange();
+ theViewFrame->getRW()->getRenderWindow()->Render();
//GetViewFrame(theStudyFrame)->Repaint();
}
+ void RepaintView(QAD_StudyFrame* theStudyFrame){
+ RepaintView(GetViewFrame(theStudyFrame));
+ }
+
VISU_Actor* UpdateViewer(QAD_StudyFrame* theStudyFrame, int theDisplaing, Prs3d_i* thePrs){
VTKViewer_ViewFrame* vf = GetViewFrame(theStudyFrame);
for ( int i = 0; i < clist.count(); i++ ) {
if ( theCurve && clist.at( i )->hasIO() && !strcmp( clist.at( i )->getIO()->getEntry(), theCurve->GetEntry() ) ) {
if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve - "<<clist.at( i ) );
- clist.at( i )->setHorTitle( strdup( theCurve->GetHorTitle().c_str() ) );
- clist.at( i )->setVerTitle( strdup( theCurve->GetVerTitle().c_str() ) );
- clist.at( i )->setHorUnits( strdup( theCurve->GetHorUnits().c_str() ) );
- clist.at( i )->setVerUnits( strdup( theCurve->GetVerUnits().c_str() ) );
- /* - DATA NOT UPDATED */
- if ( !clist.at( i )->isAutoAssign() ) {
+ clist.at( i )->setHorTitle( theCurve->GetHorTitle().c_str() );
+ clist.at( i )->setVerTitle( theCurve->GetVerTitle().c_str() );
+ clist.at( i )->setHorUnits( theCurve->GetHorUnits().c_str() );
+ clist.at( i )->setVerUnits( theCurve->GetVerUnits().c_str() );
+ double* xList = 0;
+ double* yList = 0;
+ int nbPoints = theCurve->GetData( xList, yList );
+ if ( nbPoints > 0 && xList && yList ) {
+ clist.at( i )->setData( xList, yList, nbPoints );
+ }
+ if ( !theCurve->IsAuto() ) {
clist.at( i )->setLine( (Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
clist.at( i )->setMarker( (Plot2d_Curve::MarkerType)theCurve->GetMarker() );
SALOMEDS::Color color = theCurve->GetColor();
clist.at( i )->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
- clist.at( i )->setAutoAssign( theCurve->IsAuto() );
}
+ clist.at( i )->setAutoAssign( theCurve->IsAuto() );
theView->displayCurve( clist.at( i ) );
bFound = true;
}
if ( !bFound ) {
Plot2d_Curve* crv = theCurve->CreatePresentation();
if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve (new) - "<<crv );
- if ( crv )
+ if ( crv ) {
theView->displayCurve( crv );
+ theCurve->SetLine( (VISU::Curve::LineType)crv->getLine(), crv->getLineWidth() );
+ theCurve->SetMarker( (VISU::Curve::MarkerType)crv->getMarker());
+ SALOMEDS::Color newColor;
+ newColor.R = crv->getColor().red()/255.;
+ newColor.G = crv->getColor().green()/255.;
+ newColor.B = crv->getColor().blue()/255.;
+ theCurve->SetColor( newColor );
+ crv->setAutoAssign( theCurve->IsAuto() );
+ }
}
}
else if ( theDisplaying == eDisplayOnly ) {
for ( int i = 0; i < clist.count(); i++ ) {
if ( theCurve && clist.at( i )->hasIO() && !strcmp( clist.at( i )->getIO()->getEntry(), theCurve->GetEntry() ) ) {
if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve - "<<clist.at( i ) );
- clist.at( i )->setHorTitle( strdup( theCurve->GetHorTitle().c_str() ) );
- clist.at( i )->setVerTitle( strdup( theCurve->GetVerTitle().c_str() ) );
- clist.at( i )->setHorUnits( strdup( theCurve->GetHorUnits().c_str() ) );
- clist.at( i )->setVerUnits( strdup( theCurve->GetVerUnits().c_str() ) );
- /* - DATA NOT UPDATED */
- if ( !clist.at( i )->isAutoAssign() ) {
+ clist.at( i )->setHorTitle( theCurve->GetHorTitle().c_str() );
+ clist.at( i )->setVerTitle( theCurve->GetVerTitle().c_str() );
+ clist.at( i )->setHorUnits( theCurve->GetHorUnits().c_str() );
+ clist.at( i )->setVerUnits( theCurve->GetVerUnits().c_str() );
+ double* xList = 0;
+ double* yList = 0;
+ int nbPoints = theCurve->GetData( xList, yList );
+ if ( nbPoints > 0 && xList && yList ) {
+ clist.at( i )->setData( xList, yList, nbPoints );
+ }
+ if ( !theCurve->IsAuto() ) {
clist.at( i )->setLine( (Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
clist.at( i )->setMarker( (Plot2d_Curve::MarkerType)theCurve->GetMarker() );
SALOMEDS::Color color = theCurve->GetColor();
clist.at( i )->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
- clist.at( i )->setAutoAssign( theCurve->IsAuto() );
}
+ clist.at( i )->setAutoAssign( theCurve->IsAuto() );
theView->displayCurve( clist.at( i ) );
bFound = true;
}
if ( !bFound ) {
Plot2d_Curve* crv = theCurve->CreatePresentation();
if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve (new) - "<<crv );
- if ( crv )
+ if ( crv ) {
theView->displayCurve( crv );
+ theCurve->SetLine( (VISU::Curve::LineType)crv->getLine(), crv->getLineWidth() );
+ theCurve->SetMarker( (VISU::Curve::MarkerType)crv->getMarker());
+ SALOMEDS::Color newColor;
+ newColor.R = crv->getColor().red()/255.;
+ newColor.G = crv->getColor().green()/255.;
+ newColor.B = crv->getColor().blue()/255.;
+ theCurve->SetColor( newColor );
+ crv->setAutoAssign( theCurve->IsAuto() );
+ }
}
}
}
}
- VISU::View_ptr ViewManager_i::GetCurrentView(){
- class TEvent: public SALOME_Event{
- SALOMEDS::Study_ptr myStudyDocument;
- public:
- TEvent( SALOMEDS::Study_ptr theStudy):
- myStudyDocument(theStudy)
- {}
- virtual void Execute(){
- if(QAD_Study* aStudy = QAD_Application::getDesktop()->findStudy( myStudyDocument )){
- if ( QAD_StudyFrame* aStudyFrame = aStudy->getActiveStudyFrame() ) {
- if(MYDEBUG)
- MESSAGE("GetCurrentView::Execute - TypeView = "<<aStudyFrame->getTypeView());
- if ( aStudyFrame->getTypeView() == VIEW_VTK ) {
- VISU::View3D_i* pView = new View3D_i(myStudyDocument);
- if(pView->Create(0))
- myResult = pView->_this();
- } else if ( aStudyFrame->getTypeView() == VIEW_PLOT2D ) {
- VISU::XYPlot_i* pView = new XYPlot_i(myStudyDocument);
- if(pView->Create(0))
- myResult = pView->_this();
- }
+ class TGetCurrentViewEvent: public SALOME_Event{
+ SALOMEDS::Study_ptr myStudyDocument;
+ public:
+ TGetCurrentViewEvent( SALOMEDS::Study_ptr theStudy):
+ myStudyDocument(theStudy),
+ myResult(VISU::View::_nil())
+ {}
+ virtual void Execute(){
+ if(QAD_Study* aStudy = QAD_Application::getDesktop()->findStudy( myStudyDocument )){
+ if ( QAD_StudyFrame* aStudyFrame = aStudy->getActiveStudyFrame() ) {
+ if(MYDEBUG)
+ MESSAGE("GetCurrentView::Execute - TypeView = "<<aStudyFrame->getTypeView());
+ if ( aStudyFrame->getTypeView() == VIEW_VTK ) {
+ VISU::View3D_i* pView = new View3D_i(myStudyDocument);
+ if(pView->Create(0))
+ myResult = pView->_this();
+ } else if ( aStudyFrame->getTypeView() == VIEW_PLOT2D ) {
+ VISU::XYPlot_i* pView = new XYPlot_i(myStudyDocument);
+ if(pView->Create(0))
+ myResult = pView->_this();
}
}
}
- typedef VISU::View_var TResult;
- TResult myResult;
- };
- TEvent* ve = new TEvent( myStudyDocument );
- ve->process();
- TEvent::TResult aResult = ve->myResult;
- ve->release();
- return aResult._retn();
+ }
+ typedef VISU::View_ptr TResult;
+ TResult myResult;
+ };
+
+ VISU::View_ptr ViewManager_i::GetCurrentView(){
+ return ProcessEvent(new TGetCurrentViewEvent( myStudyDocument ));
}
}
- VISU::TableView_ptr ViewManager_i::CreateTableView(VISU::Table_ptr theTable){
- class TEvent: public TCreateViewEvent{
- Table_ptr myTable;
- public:
- TEvent(SALOMEDS::Study_ptr theStudy,
- Table_ptr theTable):
- TCreateViewEvent(theStudy),
- myTable(theTable)
- {}
- virtual void Execute(){
- if ( CheckStudy( myStudyDocument ) ) {
- VISU::TableView_i* pView = new TableView_i(myStudyDocument);
- if(pView->Create(myTable) != NULL)
- myResult = pView->_this();
- }
+ class TCreateTableViewEvent: public TCreateViewEvent{
+ Table_ptr myTable;
+ public:
+ TCreateTableViewEvent(SALOMEDS::Study_ptr theStudy,
+ Table_ptr theTable):
+ TCreateViewEvent(theStudy),
+ myTable(theTable),
+ myResult(VISU::TableView::_nil())
+ {}
+ virtual void Execute(){
+ if ( CheckStudy( myStudyDocument ) ) {
+ VISU::TableView_i* pView = new TableView_i(myStudyDocument);
+ if(pView->Create(myTable) != NULL)
+ myResult = pView->_this();
}
- typedef VISU::TableView_var TResult;
- TResult myResult;
- };
+ }
+ typedef VISU::TableView_ptr TResult;
+ TResult myResult;
+ };
+
+ VISU::TableView_ptr ViewManager_i::CreateTableView(VISU::Table_ptr theTable){
if(MYDEBUG) MESSAGE("ViewManager_i::CreateTableView");
- TEvent* ve = new TEvent(myStudyDocument,theTable);
- ve->process();
- TEvent::TResult aResult = ve->myResult;
- ve->release();
- return aResult._retn();
+ return ProcessEvent(new TCreateTableViewEvent(myStudyDocument,theTable));
}
//===========================================================================
View_i::View_i(SALOMEDS::Study_ptr theStudy) {
+ myStudyFrame = NULL;
if(MYDEBUG) MESSAGE("View_i::View_i");
CORBA::String_var aName = theStudy->Name();
myStudy = CheckStudy(theStudy);
CORBA::Boolean XYPlot_i::SavePicture(const char* theFileName) {
- TSavePictureEvent* ve = new TSavePictureEvent(myView->getViewWidget(),theFileName);
- ve->process();
- TSavePictureEvent::TResult aResult = ve->myResult;
- ve->release();
- return aResult;
+ return ProcessEvent(new TSavePictureEvent(myView->getViewWidget(),theFileName));
}
vtkRenderer* Renderer = vf->getRenderer();
vtkActorCollection* theActors = Renderer->GetActors();
theActors->InitTraversal();
- vtkActor *actor;
- while(actor = theActors->GetNextActor()){
- if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(actor)){
+ while(vtkActor *anAct = theActors->GetNextActor()){
+ if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)){
VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d();
if(anActor->GetVisibility() && aPrs3d){
aPrs3d->Update();
CORBA::Boolean View3D_i::SavePicture(const char* theFileName) {
- TSavePictureEvent* ve = new TSavePictureEvent(myStudyFrame->getRightFrame()->getViewFrame()->getViewWidget(),theFileName);
- ve->process();
- TSavePictureEvent::TResult aResult = ve->myResult;
- ve->release();
- return aResult;
+ return ProcessEvent(new TSavePictureEvent(myStudyFrame->getRightFrame()->getViewFrame()->getViewWidget(),theFileName));
}
}
+ class TRestoreViewParamsEvent: public SALOME_Event{
+ QAD_StudyFrame* myStudyFrame;
+ const char* myName;
+ public:
+ TRestoreViewParamsEvent(QAD_StudyFrame* theStudyFrame,
+ const char* theName):
+ myStudyFrame(theStudyFrame),
+ myName(theName)
+ {}
+ virtual void Execute(){
+ myResult = View3D_i::RestoreViewParams(myStudyFrame,myName);
+ }
+ typedef CORBA::Boolean TResult;
+ TResult myResult;
+ };
+
CORBA::Boolean View3D_i::RestoreViewParams(const char* theName){
- class TEvent: public SALOME_Event{
- QAD_StudyFrame* myStudyFrame;
- const char* myName;
- public:
- TEvent(QAD_StudyFrame* theStudyFrame,
- const char* theName):
- myStudyFrame(theStudyFrame),
- myName(theName)
- {}
- virtual void Execute(){
- myResult = RestoreViewParams(myStudyFrame,myName);
- }
- typedef CORBA::Boolean TResult;
- TResult myResult;
- };
- TEvent* ve = new TEvent(myStudyFrame,theName);
- ve->process();
- TEvent::TResult aResult = ve->myResult;
- ve->release();
- return aResult;
+ return ProcessEvent(new TRestoreViewParamsEvent(myStudyFrame,theName));
}
}
//-------------------- View interface --------------------
+
+ void View_i::ShowPart( VISU::View::ViewRepresentation ViewRepr, CORBA::Boolean state ) {
+ ProcessVoidEvent( new TSetViewRepresentation( this, ViewRepr, state ) );
+ Update();
+ }
+
+ CORBA::Boolean View_i::IsPartShown( VISU::View::ViewRepresentation Part )
+ {
+ return ProcessEvent( new TGetViewRepresentation( this, Part ) );
+ }
+
+ void View_i::SetViewWidth(CORBA::Long Width){
+ ProcessVoidEvent( new TSetViewWidthHeight( this, Width, true ) );
+ }
+
+ void View_i::SetViewHeight(CORBA::Long Height){
+ ProcessVoidEvent( new TSetViewWidthHeight( this, Height, false ) );
+ }
+
+ CORBA::Long View_i::GetViewWidth()
+ {
+ return ProcessEvent( new TGetViewWidthHeight( this, true ) );
+ }
+
+ CORBA::Long View_i::GetViewHeight()
+ {
+ return ProcessEvent( new TGetViewWidthHeight( this, false ) );
+ }
+
+ void View_i::SetViewPositionHorizontal( VISU::View::ViewPosition ViewPosHor ){
+ ProcessVoidEvent( new TSetViewPositionHorizontal( this, ViewPosHor ) );
+ }
+
+ void View_i::SetViewPositionVertical( VISU::View::ViewPosition ViewPosVer ){
+ ProcessVoidEvent( new TSetViewPositionVertical( this, ViewPosVer ) );
+ }
+
+ void View_i::SetRelativePosition( CORBA::Double x, CORBA::Double y )
+ {
+ ProcessVoidEvent( new TSetRelativePosition( this, x, y ) );
+ }
+
+ void View_i::SetRelativeSize( CORBA::Double x, CORBA::Double y )
+ {
+ ProcessVoidEvent( new TSetRelativeSize( this, x, y ) );
+ }
+
+
+
+
void View3D_i::SetTitle(const char* theTitle){
ProcessVoidEvent(new TVoidMemFun1ArgEvent<QAD_StudyFrame,const QString&,QString>
(myStudyFrame,&QAD_StudyFrame::setTitle,QString(theTitle)));
ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,myStudyFrame,aScale));
}
//===========================================================================
-};
-/*! SAN & VSR : Test QT_EVENT
- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-*/
-#include "VISU_Gen_i.hh"
-#include "QAD_Config.h"
-#include <vtkPolyDataMapper.h>
-#include <vtkSphereSource.h>
-#include <vtkProperty.h>
+ VISU_Actor* GetActor(VISU::Prs3d_i* thePrs3d, VTKViewer_ViewFrame* theVTKFrame){
+ vtkActor *anActor;
+ vtkActorCollection *anActColl = theVTKFrame->getRenderer()->GetActors();
+ anActColl->InitTraversal();
+ while(vtkActor *anActor = anActColl->GetNextActor())
+ if(VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor))
+ if(thePrs3d == anVISUActor->GetPrs3d())
+ return anVISUActor->GetParent();
+ return NULL;
+ }
-namespace VISU{
- class TestViewEvent : public SALOME_Event {
- public:
- virtual void Execute(){
- QAD_Desktop* desktop = QAD_Application::getDesktop();
- QAD_Study* aStudy = desktop->getActiveStudy();
- if ( !aStudy ) {
- QString defViewer = QAD_CONFIG->getSetting( "Viewer::DefaultViewer" );
- int dv = defViewer.toInt();
- QAD_CONFIG->addSetting( "Viewer::DefaultViewer", QString::number( VIEW_VTK ) );
- desktop->createStudy();
- if ( !defViewer.isEmpty() ) {
- QAD_CONFIG->addSetting( "Viewer::DefaultViewer", QString::number( dv ) );
+
+ void DeletePrs3d(Prs3d_ptr thePrs3d){
+ if(Prs3d_i* aPrs3d = dynamic_cast<Prs3d_i*>(GetServant(thePrs3d).in())){
+ SALOMEDS::SObject_var aSObject = aPrs3d->GetSObject();
+ SALOMEDS::Study_var aStudyDocument = aSObject->GetStudy();
+ if(QAD_Desktop* aDesktop = QAD_Application::getDesktop()){
+ if(QAD_Study* aStudy = aDesktop->findStudy(aStudyDocument)){
+ aStudy->unHighlightAll();
+ int aNbStudyFrames = aStudy->getStudyFramesCount();
+ for(int aFrameId = 0; aFrameId < aNbStudyFrames; aFrameId++){
+ if(QAD_StudyFrame* aFrame = aStudy->getStudyFrame(aFrameId)){
+ QAD_ViewFrame* aViewFrame = aFrame->getRightFrame()->getViewFrame();
+ if(VTKViewer_ViewFrame* aVTKFrame = dynamic_cast<VTKViewer_ViewFrame*>(aViewFrame)){
+ if(VISU_Actor* anActor = VISU::GetActor(aPrs3d,aVTKFrame)){
+ aVTKFrame->RemoveActor(anActor);
+ anActor->Delete();
+ }
+ aVTKFrame->unHighlightAll();
+ }
+ }
+ }
+
+ aPrs3d->RemoveFromStudy();
+ aPrs3d->Destroy();
+
+ aStudy->updateObjBrowser(); //update Object browser
}
}
- else {
- aStudy->newWindow3d( "", VIEW_VTK );
- }
}
- };
+ }
+
- void VISU_Gen_i::CreateTestView() {
- TestViewEvent* ve = new TestViewEvent();
- ve->process();
- ve->release();
+ void VISU_Gen_i::DeleteResult(Result_ptr theResult)
+ {
+ class TEvent: public SALOME_Event{
+ Result_ptr myResult;
+ public:
+ TEvent(Result_ptr theResult): myResult(theResult) {}
+ virtual void Execute(){
+ if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(myResult).in())){
+ SALOMEDS::SObject_var aSObject = aResult->GetSObject();
+ SALOMEDS::Study_var aStudyDocument = aSObject->GetStudy();
+ SALOMEDS::ChildIterator_var aChildIter = aStudyDocument->NewChildIterator(aSObject);
+ for(aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()){
+ SALOMEDS::SObject_var aChildSObject = aChildIter->Value();
+ CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject);
+ if(CORBA::is_nil(aChildObj)) continue;
+ VISU::Prs3d_var aPrs3d = VISU::Prs3d::_narrow(aChildObj);
+ if(CORBA::is_nil(aPrs3d)) continue;
+ VISU::DeletePrs3d(aPrs3d);
+ }
+
+ aResult->RemoveFromStudy();
+ aResult->Destroy();
+
+ if(QAD_Desktop* aDesktop = QAD_Application::getDesktop())
+ if(QAD_Study* aStudy = aDesktop->findStudy(aStudyDocument))
+ aStudy->updateObjBrowser(); //update Object browser
+ }
+ }
+ };
+
+ ProcessVoidEvent(new TEvent(theResult));
}
- class TestObjectEvent : public SALOME_Event {
- public:
- virtual void Execute(){
- float aRadius = 150.0 * random() / RAND_MAX + 10.;
- float aX = 1000.0 * random() / RAND_MAX - 500.;
- float aY = 1000.0 * random() / RAND_MAX - 500.;
- float aZ = 1000.0 * random() / RAND_MAX - 500.;
- float aR = (float)random() / RAND_MAX;
- float aG = (float)random() / RAND_MAX;
- float aB = (float)random() / RAND_MAX;
-
- vtkSphereSource* aSource = vtkSphereSource::New();
- aSource->SetRadius( aRadius );
- aSource->SetCenter( aX, aY, aZ );
-
- vtkProperty* prop = vtkProperty::New();
- prop->SetColor( aR, aG, aB );
-
- vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New();
- aMapper->SetInput( aSource->GetOutput() );
-
- vtkActor* sphere = vtkActor::New();
- sphere->SetMapper( aMapper );
- sphere->SetProperty( prop );
-
- QAD_Desktop* desktop = QAD_Application::getDesktop();
- QAD_Study* aStudy = desktop->getActiveStudy();
- if ( !aStudy )
- return ;
- QAD_StudyFrame* sf = desktop->getActiveStudy()->getActiveStudyFrame();
- VTKViewer_ViewFrame* vf = GetViewFrame( sf );
- if ( !vf )
- return;
- sphere->SetVisibility( true );
- vf->getRenderer()->AddActor(sphere);
- vf->Repaint();
- }
- };
+ void VISU_Gen_i::DeletePrs3d(Prs3d_ptr thePrs3d)
+ {
+ class TEvent: public SALOME_Event{
+ Prs3d_ptr myPrs3d;
+ public:
+ TEvent(Prs3d_ptr thePrs3d): myPrs3d(thePrs3d) {}
+ virtual void Execute(){
+ VISU::DeletePrs3d(myPrs3d);
+ }
+ };
- void VISU_Gen_i::ShowTestObject() {
- TestObjectEvent* ve = new TestObjectEvent();
- ve->process();
- ve->release();
- return;
+ ProcessVoidEvent(new TEvent(thePrs3d));
}
- /*! SAN & VSR : Test QT_EVENT
- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- */
-};
+
+}
class View_i : public virtual POA_VISU::View,
public virtual Storable
{
- protected:
- QAD_Study* myStudy;
public:
+ QAD_Study* myStudy;
+ QAD_StudyFrame* myStudyFrame;
+
+ public:
+ virtual void ShowPart( VISU::View::ViewRepresentation ViewRepr, CORBA::Boolean state );
+ virtual CORBA::Boolean IsPartShown( VISU::View::ViewRepresentation ViewRepr );
+ virtual void SetViewWidth(CORBA::Long Width);
+ virtual void SetViewHeight(CORBA::Long Height);
+ virtual CORBA::Long GetViewWidth();
+ virtual CORBA::Long GetViewHeight();
+ virtual void SetViewPositionHorizontal(VISU::View::ViewPosition ViewPosHor);
+ virtual void SetViewPositionVertical(VISU::View::ViewPosition ViewPosVer);
+
+ virtual void SetRelativePosition( CORBA::Double x, CORBA::Double y );
+ virtual void SetRelativeSize( CORBA::Double x, CORBA::Double y );
+
View_i(SALOMEDS::Study_ptr theStudy);
virtual ~View_i();
virtual void SetBackground(const SALOMEDS::Color& theColor);
virtual void Close() = 0;
virtual void ToStream(std::ostringstream& theStr);
virtual const char* GetComment() const;
+
public:
virtual std::string View_i::GetEntry();
};
virtual void Close();
protected:
- QAD_StudyFrame* myStudyFrame;
Plot2d_ViewFrame* myView;
public:
virtual Storable* Create(int theNew);
virtual void Close();
protected:
- QAD_StudyFrame* myStudyFrame;
static int myNbViewParams;
public:
virtual Storable* Create(int theNew);
virtual void ToStream(std::ostringstream& theStr);
virtual const char* GetComment() const;
- static const string myComment;
+ static const std::string myComment;
QAD_StudyFrame* GetStudyFrame() const { return myStudyFrame;}
};
VTKViewer_ViewFrame* GetViewFrame(QAD_StudyFrame* theStudyFrame);
vtkRenderer* GetRenderer(QAD_StudyFrame* theStudyFrame);
vtkCamera* GetCamera(QAD_StudyFrame* theStudyFrame);
+
+ void RepaintView(VTKViewer_ViewFrame* theViewFrame);
void RepaintView(QAD_StudyFrame* theStudyFrame);
enum Displaing {eDisplayAll, eDisplay, eDisplayOnly, eErase, eEraseAll};
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_table.py visu_big_table.py visu_view.py visu_delete.py\
visu_swig_test.py test_events.py batch_test_events.py
EXPORT_SHAREDPYSCRIPTS = VISU_shared_modules.py
myNamingService = theNamingService
myLifeCycleCORBA = theLifeCycleCORBA
myLocalStudyManager = theStudyManager
- mySession = myNamingService.Resolve("/Kernel/Session")
+ while mySession == None:
+ mySession = myNamingService.Resolve("/Kernel/Session")
mySession = mySession._narrow(SALOME.Session)
mySession.GetInterface()
myDelay = theDelay
--- /dev/null
+import VISU
+import SALOMEDS
+from visu_gui import *
+
+myViewManager = myVisu.GetViewManager();
+myView = myViewManager.Create3DView();
+
+medFile = "fra.med"
+myFieldName = "VITESSE";
+
+aMeshName ="LE VOLUME"
+anEntity = VISU.NODE
+aTimeStampId = 1
+
+medFile = os.getenv('KERNEL_ROOT_DIR') + '/examples/' + medFile
+myResult = myVisu.ImportFile(medFile)
+
+aScalarMap = myVisu.ScalarMapOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
+myView.Display(aScalarMap);
+myView.FitAll();
+
+aCutPlanes = myVisu.CutPlanesOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
+myView = myViewManager.Create3DView();
+myView.Display(aCutPlanes);
+myView.FitAll();
+
+myVisu.DeletePrs3d(aScalarMap)
+myVisu.DeleteResult(myResult)