p.whs2 { margin-top:0px; margin-bottom:0px; }\r
img_whs3 { border:none; float:none; width:30px; height:30px; border-style:none; }\r
p.whs4 { margin-left:40px; margin-top:0px; margin-bottom:0px; }\r
-p.whs5 { font-style:italic; color:#ff0000; margin-left:40px; margin-top:0px; margin-bottom:0px; }\r
-img_whs6 { border:none; width:31px; height:27px; float:none; border-style:none; }\r
-p.whs7 { margin-left:0px; margin-top:0px; margin-bottom:0px; }\r
-p.whs8 { margin-left:0px; background-image:url('../texture_horiz_ltbluebubbles.jpg'); margin-top:0px; margin-bottom:0px; }\r
-img_whs9 { border:none; float:none; width:36px; height:38px; border-style:none; }\r
-img_whs10 { border:none; width:336px; height:501px; float:none; border-style:none; }\r
-ul.whs11 { list-style:disc; }\r
-p.whs12 { margin-left:36px; margin-top:0px; margin-bottom:0px; }\r
-p.whs13 { font-weight:bold; margin-left:24px; margin-top:0px; margin-bottom:0px; }\r
-p.whs14 { margin-left:40px; font-weight:bold; margin-top:0px; margin-bottom:0px; }\r
-p.whs15 { margin-left:24px; margin-top:0px; margin-bottom:0px; }\r
-p.whs16 { font-weight:bold; margin-left:36px; margin-top:0px; margin-bottom:0px; }\r
-p.whs17 { margin-left:60px; margin-top:0px; margin-bottom:0px; }\r
-p.whs18 { margin-left:36px; font-weight:bold; margin-top:0px; margin-bottom:0px; }\r
-p.whs19 { margin-left:120px; margin-top:0px; margin-bottom:0px; }\r
-img_whs20 { border:none; width:308px; height:241px; float:none; border-style:none; }\r
-p.whs21 { margin-left:72px; margin-top:0px; margin-bottom:0px; }\r
-p.whs22 { margin-left:48px; margin-top:0px; margin-bottom:0px; }\r
-img_whs23 { border:none; width:433px; height:303px; float:none; border-style:none; }\r
+p.whs5 { margin-top:0px; margin-bottom:0px; margin-left:72px; }\r
+p.whs6 { font-style:italic; color:#ff0000; margin-left:40px; margin-top:0px; margin-bottom:0px; }\r
+img_whs7 { border:none; width:31px; height:27px; float:none; border-style:none; }\r
+p.whs8 { margin-left:0px; margin-top:0px; margin-bottom:0px; }\r
+p.whs9 { margin-left:0px; background-image:url('../texture_horiz_ltbluebubbles.jpg'); margin-top:0px; margin-bottom:0px; }\r
+img_whs10 { border:none; float:none; width:36px; height:38px; border-style:none; }\r
+img_whs11 { border:none; width:374px; height:643px; float:none; border-style:none; }\r
+ul.whs12 { list-style:disc; }\r
+p.whs13 { margin-left:36px; margin-top:0px; margin-bottom:0px; }\r
+p.whs14 { margin-left:36px; margin-top:0px; margin-bottom:0px; font-weight:bold; }\r
+p.whs15 { font-weight:bold; margin-left:24px; margin-top:0px; margin-bottom:0px; }\r
+p.whs16 { margin-left:40px; font-weight:bold; margin-top:0px; margin-bottom:0px; }\r
+p.whs17 { margin-left:24px; margin-top:0px; margin-bottom:0px; }\r
+p.whs18 { font-weight:bold; margin-left:36px; margin-top:0px; margin-bottom:0px; }\r
+p.whs19 { margin-left:60px; margin-top:0px; margin-bottom:0px; }\r
+p.whs20 { margin-top:0px; margin-bottom:0px; margin-left:36px; }\r
+p.whs21 { margin-left:36px; font-weight:bold; margin-top:0px; margin-bottom:0px; }\r
+p.whs22 { margin-left:120px; margin-top:0px; margin-bottom:0px; }\r
+img_whs23 { border:none; width:308px; height:241px; float:none; border-style:none; }\r
+p.whs24 { margin-left:72px; margin-top:0px; margin-bottom:0px; }\r
+p.whs25 { margin-left:48px; margin-top:0px; margin-bottom:0px; }\r
+img_whs26 { border:none; width:433px; height:303px; float:none; border-style:none; }\r
-->\r
</style><script type="text/javascript" language="JavaScript">\r
<!--\r
strNSS += "p.whs2 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs4 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs5 {margin-top:1pt;margin-bottom:1pt; }";\r
- strNSS += "p.whs7 {margin-left:1pt;margin-top:1pt;margin-bottom:1pt; }";\r
+ strNSS += "p.whs6 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs8 {margin-left:1pt;margin-top:1pt;margin-bottom:1pt; }";\r
- strNSS += "p.whs12 {margin-top:1pt;margin-bottom:1pt; }";\r
+ strNSS += "p.whs9 {margin-left:1pt;margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs13 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs14 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs15 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs17 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs18 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs19 {margin-top:1pt;margin-bottom:1pt; }";\r
+ strNSS += "p.whs20 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs21 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs22 {margin-top:1pt;margin-bottom:1pt; }";\r
+ strNSS += "p.whs24 {margin-top:1pt;margin-bottom:1pt; }";\r
+ strNSS += "p.whs25 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS +="</style>";\r
document.write(strNSS);\r
}\r
\r
<p class="whs2"> </p>\r
\r
-<p class="whs4">- creating of a 3D presentation on the \r
- basis of a field;</p>\r
+<p class="whs4">- creating a 3D presentation on the basis \r
+ of a field:</p>\r
\r
-<p class="whs4">- coloring of the cells of this presentation, \r
+<p class="whs5"> - \r
+ on the whole mesh (default)</p>\r
+\r
+<p class="whs5"> - \r
+ on group(s) of the mesh</p>\r
+\r
+<p class="whs4">- coloring the cells of this presentation, \r
according the scalar or vector values applied to this cells;</p>\r
\r
-<p class="whs4">- creating of a scalar bar: a scale, representing \r
- the correspondence between \r
+<p class="whs4">- creating a scalar bar representing the \r
+ correspondence between \r
the scalar values of the field and the used colors. </p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs2">All other types of field \r
- presentation are based on the <span style="font-weight: bold;"><B>Scalar \r
+ presentations are based on the <span style="font-weight: bold;"><B>Scalar \r
Map. </B></span></p>\r
\r
<p class="whs2"> </p>\r
style="margin-top: 0px; margin-bottom: 0px;">To create a Scalar Map \r
presentation:</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs6"> </p>\r
\r
<p class="whs4">- Right-click on one of the time stamps \r
of the field in the Object browser and from the pop-up menu choose <span \r
style="font-weight: bold;"><B>Scalar Map, </B></span><span>or</span></p>\r
\r
-<p class="whs4"> </p>\r
-\r
<p class="whs4">- Click on one of the time stamps of the \r
field in the Object browser and select from the main menu <span style="font-weight: bold;"><B>Visualization \r
- > Scalar Map</B></span>, or click <img src="../pics/scalarmapicon.jpg" x-maintain-ratio="TRUE" width="31px" height="27px" border="0" class="img_whs6"> icon<span style="font-weight: bold;"> \r
+ > Scalar Map</B></span>, or click <img src="../pics/scalarmapicon.jpg" x-maintain-ratio="TRUE" width="31px" height="27px" border="0" class="img_whs7"> icon<span style="font-weight: bold;"> \r
<B></B></span>in the <span style="font-weight: bold;"><B>Visualization Toolbar</B></span></p>\r
\r
<p class="whs4"> </p>\r
\r
-<p class="whs7">The following dialog box will appear:</p>\r
+<p class="whs8">The following dialog box will appear:</p>\r
\r
-<p class="whs7"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs8"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs9">This dialog box is equal \r
+<p class="whs9"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs10">This dialog box is equal \r
for all types of field presentations and it will be present as an additional \r
tab in all dialog boxes allowing to create the other types of presentations. \r
It allows to set the parameters of <span style="font-weight: bold;"><B>Scalar \r
\r
<p class="whs4"> </p>\r
\r
-<p class="whs7"> <img src="../pics/scalarbarproperties.png" x-maintain-ratio="TRUE" width="336px" height="501px" border="0" class="img_whs10"></p>\r
+<p class="whs8"> <img src="../pics/scalarbarproperties.png" x-maintain-ratio="TRUE" width="374px" height="643px" border="0" class="img_whs11"></p>\r
+\r
+<p class="whs8"> </p>\r
+\r
+<ul type="disc" class="whs12">\r
+ \r
+ <li class=kadov-p><p class="whs13"><span style="font-weight: bold;"><B>Build \r
+ presentation on groups</B></span>: You can choose the groups on which <span \r
+ style="font-weight: bold;"><B>Scalar Map</B></span> can be built from the list \r
+ to the left and add them in the list to the right.</p></li>\r
+</ul>\r
\r
-<p class="whs7"> </p>\r
+<p class="whs13"><span> </span></p>\r
\r
-<ul type="disc" class="whs11">\r
+<ul type="disc" class="whs12">\r
\r
- <li class=kadov-p><p class="whs12"><span style="font-weight: bold;"><B>Scalar \r
- range parameters:</B></span></p></li>\r
+ <li class=kadov-p><p class="whs14">Scalar range parameters:</p></li>\r
</ul>\r
\r
-<p class="whs12"> </p>\r
+<p class="whs13"> </p>\r
\r
-<ul type="disc" class="whs11">\r
+<ul type="disc" class="whs12">\r
\r
- <ul type="disc" class="whs11">\r
+ <ul type="disc" class="whs12">\r
\r
- <li class=kadov-p><p class="whs13">Scalar Mode <span \r
+ <li class=kadov-p><p class="whs15">Scalar Mode <span \r
style="font-weight: normal;">field: This field allows to choose the mode \r
of transformation of vector values into scalar values for creation of \r
the presentation. It can be module of the vector or one of three components \r
</ul>\r
</ul>\r
\r
-<p class="whs14"> </p>\r
+<p class="whs16"> </p>\r
\r
-<ul type="disc" class="whs11">\r
+<ul type="disc" class="whs12">\r
\r
- <ul type="disc" class="whs11">\r
+ <ul type="disc" class="whs12">\r
\r
- <li class=kadov-p><p class="whs13">Logarithmic scaling \r
+ <li class=kadov-p><p class="whs15">Logarithmic scaling \r
<span style="font-weight: normal;">check box: You can apply logarithmic \r
scaling to the color scale of the presentation.</span></p></li>\r
</ul>\r
</ul>\r
\r
-<p class="whs15"> </p>\r
+<p class="whs17"> </p>\r
\r
-<ul type="disc" class="whs11">\r
+<ul type="disc" class="whs12">\r
\r
- <ul type="disc" class="whs11">\r
+ <ul type="disc" class="whs12">\r
\r
- <li class=kadov-p><p class="whs15"><span style="font-weight: bold;"><B>Use \r
+ <li class=kadov-p><p class="whs17"><span style="font-weight: bold;"><B>Use \r
field range: </B></span>if this check box is selected, all cells of the field \r
presentation will be colored according the values applied to these cells. \r
</p></li>\r
</ul>\r
</ul>\r
\r
-<p class="whs15"> </p>\r
+<p class="whs17"> </p>\r
\r
-<ul type="disc" class="whs11">\r
+<ul type="disc" class="whs12">\r
\r
- <ul type="disc" class="whs11">\r
+ <ul type="disc" class="whs12">\r
\r
- <li class=kadov-p><p class="whs13">Use imposed range: \r
+ <li class=kadov-p><p class="whs15">Use imposed range: \r
<span style="font-weight: normal;">here you can define your own range \r
of scalar values of the field, on the basis of which this presentation \r
will be constructed. The cells of the field presentation with applied \r
\r
<p class="whs4"> </p>\r
\r
-<ul type="disc" class="whs11">\r
+<ul type="disc" class="whs12">\r
\r
- <li class=kadov-p><p class="whs16">Colors and Labels</p></li>\r
+ <li class=kadov-p><p class="whs18">Colors and Labels</p></li>\r
\r
- <li class=kadov-p><p class="whs17"><span style="font-weight: bold;"><B>Nb. \r
+ <li class=kadov-p><p class="whs19"><span style="font-weight: bold;"><B>Nb. \r
of colors </B></span>field: In this field you can enter the number of colors, \r
which will be used for coloring of cells containing scalar values.</p></li>\r
\r
- <li class=kadov-p><p class="whs17"><span style="font-weight: bold;"><B>Nb. \r
+ <li class=kadov-p><p class="whs19"><span style="font-weight: bold;"><B>Nb. \r
of labels </B></span>field: In this field you can enter the number of labels, \r
indicating graduation of the scalar bar.</p></li>\r
</ul>\r
\r
<p class="whs4"> </p>\r
\r
-<ul type="disc" class="whs11">\r
+<ul type="disc" class="whs12">\r
\r
- <li class=kadov-p><p class="whs7"><span style="font-weight: bold;"><B>Orientation: \r
+ <li class=kadov-p><p class="whs20"><span style="font-weight: bold;"><B>Orientation: \r
</B></span>You can select <span style="font-weight: bold;"><B>Vertical </B></span>or<span \r
style="font-weight: bold;"><B> Horizontal </B></span>orientation of the scalar \r
bar. </p></li>\r
\r
<p class="whs4"> </p>\r
\r
-<ul type="disc" class="whs11">\r
+<ul type="disc" class="whs12">\r
\r
- <li class=kadov-p><p class="whs7"><span style="font-weight: bold;"><B>Origin:</B></span> \r
+ <li class=kadov-p><p class="whs20"><span style="font-weight: bold;"><B>Origin:</B></span> \r
you can enter <span style="font-weight: bold;"><B>X</B></span> & <span style="font-weight: bold;"><B>Y</B></span> \r
coordinates of the origin of the scalar bar.</p></li>\r
</ul>\r
\r
<p class="whs4"> </p>\r
\r
-<ul type="disc" class="whs11">\r
+<ul type="disc" class="whs12">\r
\r
- <li class=kadov-p><p class="whs7"> <span \r
+ <li class=kadov-p><p class="whs20"> <span \r
style="font-weight: bold;"><B>Dimensions</B></span>: \r
you can enter <span style="font-weight: bold;"><B>Width</B></span> and <span \r
style="font-weight: bold;"><B>Height</B></span> of the scalar bar.</p></li>\r
\r
<p class="whs4"> </p>\r
\r
-<ul type="disc" class="whs11">\r
+<ul type="disc" class="whs12">\r
\r
- <li class=kadov-p><p class="whs7"><span style="font-weight: bold;"><B>Save \r
+ <li class=kadov-p><p class="whs20"><span style="font-weight: bold;"><B>Save \r
as default values </B></span>check box allows to save this parameters for \r
all presentations, which will be constructed later.</p></li>\r
</ul>\r
\r
-<p class="whs7"> </p>\r
+<p class="whs8"> </p>\r
\r
-<ul type="disc" class="whs11">\r
+<ul type="disc" class="whs12">\r
\r
- <li class=kadov-p><p class="whs18">Text properties <span \r
+ <li class=kadov-p><p class="whs21">Text properties <span \r
style="font-weight: normal;">button allows you to define from the following \r
dialog box:</span></p></li>\r
</ul>\r
\r
<p class="whs4"> </p>\r
\r
-<p class="whs19"><img src="../pics/textproperty.png" x-maintain-ratio="TRUE" width="308px" height="241px" border="0" class="img_whs20"></p>\r
+<p class="whs22"><img src="../pics/textproperty.png" x-maintain-ratio="TRUE" width="308px" height="241px" border="0" class="img_whs23"></p>\r
\r
-<p class="whs12"> </p>\r
+<p class="whs13"> </p>\r
\r
-<ul type="disc" class="whs11">\r
+<ul type="disc" class="whs12">\r
\r
- <li class=kadov-p><p class="whs21"><span style="font-weight: bold;"><B>Title</B></span> \r
+ <li class=kadov-p><p class="whs24"><span style="font-weight: bold;"><B>Title</B></span> \r
of the field, on the basis of which this presentation is created,</p></li>\r
\r
- <li class=kadov-p><p class="whs21">Font<span style="font-weight: bold;"> \r
+ <li class=kadov-p><p class="whs24">Font<span style="font-weight: bold;"> \r
<B></B></span>properties of the <span style="font-weight: bold;"><B>Title</B></span>, \r
displayed in the Viewer</p></li>\r
\r
- <li class=kadov-p><p class="whs21">Font<span style="font-weight: bold;"> \r
+ <li class=kadov-p><p class="whs24">Font<span style="font-weight: bold;"> \r
<B></B></span>properties of the <span style="font-weight: bold;"><B>Labels</B></span>, \r
displayed in the Viewer. </p></li>\r
</ul>\r
\r
-<p class="whs21"> </p>\r
+<p class="whs24"> </p>\r
\r
-<p class="whs22">After you have finished with setting these \r
+<p class="whs25">After you have finished with setting these \r
parameters, click <span style="font-weight: bold;"><B>OK. </B></span>Your presentation \r
with scalar bar will be immediately displayed in the viewer: </p>\r
\r
-<p class="whs7"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs4"> <img src="../pics/scalarrangesn.png" x-maintain-ratio="TRUE" width="433px" height="303px" border="0" class="img_whs23"></p>\r
+<p class="whs4"> <img src="../pics/scalarrangesn.png" x-maintain-ratio="TRUE" width="433px" height="303px" border="0" class="img_whs26"></p>\r
\r
-<p class="whs7"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs7">\r
+<p class="whs8">\r
<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;} if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','Creating field presentations','creating_field_presentations.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
\r
\r
</p>\r
\r
-<p class="whs7"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs7"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs7"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs7"> </p>\r
+<p class="whs8"> </p>\r
\r
<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
//-------------------------------------------------------
typedef string IdType;
+ typedef sequence<string> string_array;
+
/*!
* This enumeration contains a set of elements defining the type
* of the scaling, which can be applied on different presentations.
TDEFORMEDSHAPE, /*!< Deformed shape 3D presentation object */
TSCALARMAPONDEFORMEDSHAPE, /*!< Scalar map on deformed shape 3D presentation object */
TGAUSSPOINTS, /*!< Gauss Points 3D presentation object */
+ TPRSMERGER, /*!< PRS merger 3D presentation object */
TPLOT3D, /*!< Plot3D 3D presentation object */
TCUTPLANES, /*!< Cut planes 3D presentation object */
TCUTLINES, /*!< Cut lines 3D presentation object */
* Gets the type of orientation of the scalar bar (to provide backward compatibility).
*/
Orientation GetBarOrientation();
+
+ /*!
+ * PrsMerger method:
+ * Set mesh on group as geometry of presentation.(clear all previously added groups).
+ * \param theMeshName - mesh name
+ * \param theGroupName - group name
+ */
+ void SetMeshOnGroup(in string theMeshName,
+ in string theGroupName);
+
+ /*!
+ * PrsMerger method:
+ * Add group as geometry of presentation.
+ * \param theMeshName - mesh name
+ * \param theGroupName - group name
+ */
+ long AddMeshOnGroup(in string theMeshName,
+ in string theGroupName);
+
+
+ /*!
+ * PrsMerger method:
+ * Set scalar map of presentation.
+ * \param theMeshName - mesh name
+ * \param theFieldName - the name of scalar field
+ * \param theStampsNum - the iteration number for scalar field
+ * \param theEntity - entity of scalar field
+ */
+ void SetScalarMap(in string theMeshName,
+ in Entity theEntity,
+ in string theFieldName,
+ in long theStampsNum);
+
+ /*!
+ * PrsMerger method:
+ * Remove all groups.(The scalar map will be placed on all mesh).
+ */
+ void RemoveAllGeom();
};
//-------------------------------------------------------
void SetColor(in SALOMEDS::Color theColor);
};
+
//-------------------------------------------------------
/*! \brief Scalar Map on Deformed shape presentation interface
*
void SetScalarField(in string theMeshName,in string theFieldName,
in long theIteration,in Entity theEntity);
+
+ /*!
+ * Get scalar iteration number
+ */
+ long GetScalarLIteration();
+
+ /*!
+ * Get scalar entity
+ */
+ Entity GetScalarEEntity();
+
+ /*!
+ * Get scalar field name
+ */
+ string GetScalarCFieldName();
+
+ /*!
+ * Get mesh name
+ */
+ string GetScalarCMeshName();
+
};
//-------------------------------------------------------
/*!
TVTKOutput*
GetVTKOutput();
};
+ typedef SharedPtr<TAppendFilter> PAppendFilter;
//---------------------------------------------------------------
return myVisuGen->Plot3DOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
-
Table_ptr VISU_Gen_i::CreateTable(const char* theTableEntry){
return myVisuGen->CreateTable(theTableEntry);
}
virtual ScalarMapOnDeformedShape_ptr ScalarMapOnDeformedShapeOnField
(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, CORBA::Double theIteration);
+
//Create Digital Presentation
virtual Table_ptr CreateTable(const char* theTableEntry);
virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
VISU_PlanesWidget.hxx \
VISU_SphereWidget.hxx \
VISU_WidgetCtrl.hxx \
- VISU_ScalarMapOnDeformedShapePL.hxx
+ VISU_ScalarMapOnDeformedShapePL.hxx \
+ VISU_PrsMergerPL.hxx
# Libraries targets
VISU_SphereWidget.cxx \
VISU_WidgetCtrl.cxx \
VISU_ScalarBarCtrl.cxx \
- VISU_ScalarMapOnDeformedShapePL.cxx
+ VISU_ScalarMapOnDeformedShapePL.cxx \
+ VISU_PrsMergerPL.cxx
# Executables targets
CorrectPnt(myBasePnt,aBaseBounds);
- VISU_ScalarMapPL::Update();
+ VISU_PrsMergerPL::Update();
}
for (int i = 0, iend = GetNbParts(); i < iend; i++)
if(!aPipeLine->IsPartDefault(i)) SetPartPosition(i, aPipeLine->GetPartPosition(i));
}
- VISU_ScalarMapPL::ShallowCopy(thePipeLine);
+ Superclass::ShallowCopy(thePipeLine);
}
void
VISU_CutPlanesPL
::Init()
{
- VISU_ScalarMapPL::Init();
+ Superclass::Init();
SetNbParts(10);
myBasePlane[0] = YZ;
CutWithPlanes(myAppendPolyData,aDataSet,myNbParts,aDir,aBounds,
myPartPosition,myPartCondition,myDisplacement[0]);
- VISU_ScalarMapPL::Update();
+ Superclass::Update();
}
void
#ifndef VISU_CutPlanesPL_HeaderFile
#define VISU_CutPlanesPL_HeaderFile
-#include "VISU_ScalarMapPL.hxx"
+#include "VISU_PrsMergerPL.hxx"
#include <vector>
class vtkAppendPolyData;
-class VISU_CutPlanesPL : public VISU_ScalarMapPL{
+class VISU_CutPlanesPL : public VISU_PrsMergerPL{
protected:
VISU_CutPlanesPL();
VISU_CutPlanesPL(const VISU_CutPlanesPL&);
public:
- vtkTypeMacro(VISU_CutPlanesPL,VISU_ScalarMapPL);
+ vtkTypeMacro(VISU_CutPlanesPL,VISU_PrsMergerPL);
static VISU_CutPlanesPL* New();
virtual
if(VISU_DeformedShapePL *aPipeLine = dynamic_cast<VISU_DeformedShapePL*>(thePipeLine)){
SetScale(aPipeLine->GetScale());
}
- VISU_ScalarMapPL::ShallowCopy(thePipeLine);
+ TSupperClass::ShallowCopy(thePipeLine);
}
vtkFloatingPointType
VISU_DeformedShapePL
::Init()
{
- VISU_ScalarMapPL::Init();
+ TSupperClass::Init();
vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
vtkDataSet* aDataSet = GetInput2();
+ //vtkDataSet* aDataSet = GetScalars()->GetInput();
vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
static double EPS = 1.0 / VTK_LARGE_FLOAT;
VISU_DeformedShapePL
::Update()
{
- VISU_ScalarMapPL::Update();
+ TSupperClass::Update();
}
void
VISU_DeformedShapePL
::SetMapScale(vtkFloatingPointType theMapScale)
{
- VISU_ScalarMapPL::SetMapScale(theMapScale);
+ TSupperClass::SetMapScale(theMapScale);
myWarpVector->SetScaleFactor(myScaleFactor*theMapScale);
Modified();
#ifndef VISU_DeformedShapePL_HeaderFile
#define VISU_DeformedShapePL_HeaderFile
-#include "VISU_ScalarMapPL.hxx"
+#include "VISU_PrsMergerPL.hxx"
class vtkCellDataToPointData;
class SALOME_Transform;
class vtkWarpVector;
-class VISU_DeformedShapePL : public VISU_ScalarMapPL
+class VISU_DeformedShapePL : public VISU_PrsMergerPL
{
+ typedef VISU_PrsMergerPL TSupperClass;
+
protected:
VISU_DeformedShapePL();
VISU_DeformedShapePL(const VISU_DeformedShapePL&);
~VISU_DeformedShapePL();
public:
- vtkTypeMacro(VISU_DeformedShapePL,VISU_ScalarMapPL);
+ vtkTypeMacro(VISU_DeformedShapePL,TSupperClass);
static
VISU_DeformedShapePL*
output->GetPointData()->CopyVectorsOn();
int aNbElems = input->GetNumberOfPoints();
vtkPointData *inData = input->GetPointData(), *outData = output->GetPointData();
- if(inData->GetAttribute(vtkDataSetAttributes::VECTORS))
+ if(!inData->GetAttribute(vtkDataSetAttributes::SCALARS))
execute(aNbElems,myScalarMode,inData,outData);
else
output->GetPointData()->CopyScalarsOn();
vtkFloatingPointType aRange[2] = {aPipeLine->GetMin(), aPipeLine->GetMax()};
SetRange(aRange);
}
- VISU_ScalarMapPL::ShallowCopy(thePipeLine);
+ TSupperClass::ShallowCopy(thePipeLine);
}
int
VISU_IsoSurfacesPL
::SetScaling(int theScaling)
{
- VISU_ScalarMapPL::SetScaling(theScaling);
+ TSupperClass::SetScaling(theScaling);
SetRange(myRange);
}
void
VISU_IsoSurfacesPL
::Init()
{
- VISU_ScalarMapPL::Init();
+ TSupperClass::Init();
SetNbParts(10);
vtkFloatingPointType aScalarRange[2];
VISU_IsoSurfacesPL
::Update()
{
- VISU_ScalarMapPL::Update();
+ TSupperClass::Update();
}
void
VISU_IsoSurfacesPL
::SetMapScale(vtkFloatingPointType theMapScale)
{
- VISU_ScalarMapPL::SetMapScale(theMapScale);
+ TSupperClass::SetMapScale(theMapScale);
vtkFloatingPointType aRange[2] = {GetMax() - theMapScale*(GetMax()-GetMin()), GetMax()};
vtkFloatingPointType aNewRange[2] = {aRange[0], aRange[1]};
#ifndef VISU_IsoSurfacesPL_HeaderFile
#define VISU_IsoSurfacesPL_HeaderFile
-#include "VISU_ScalarMapPL.hxx"
+#include "VISU_PrsMergerPL.hxx"
class vtkContourFilter;
class vtkCellDataToPointData;
-class VISU_IsoSurfacesPL : public VISU_ScalarMapPL
+class VISU_IsoSurfacesPL : public VISU_PrsMergerPL
{
+ typedef VISU_ScalarMapPL TSupperClass;
+
protected:
VISU_IsoSurfacesPL();
VISU_IsoSurfacesPL(const VISU_IsoSurfacesPL&);
~VISU_IsoSurfacesPL();
public:
- vtkTypeMacro(VISU_IsoSurfacesPL,VISU_ScalarMapPL);
+ vtkTypeMacro(VISU_IsoSurfacesPL,TSupperClass);
static
VISU_IsoSurfacesPL*
SetContourPrs( aPipeLine->GetIsContourPrs() );
SetNumberOfContours( aPipeLine->GetNumberOfContours() );
}
- VISU_ScalarMapPL::ShallowCopy(thePipeLine);
+ TSupperClass::ShallowCopy(thePipeLine);
}
VISU_CutPlanesPL::PlaneOrientation
VISU_Plot3DPL::
Init()
{
- VISU_ScalarMapPL::Init();
+ TSupperClass::Init();
myOrientation = GetOrientation(GetInput2());
SetScaleFactor(GetScaleFactor(GetInput2()));
myWarpScalar->SetNormal(aPlaneNormal);
- VISU_ScalarMapPL::Update();
+ TSupperClass::Update();
}
void
void VISU_Plot3DPL::SetMapScale(vtkFloatingPointType theMapScale)
{
- VISU_ScalarMapPL::SetMapScale(theMapScale);
+ TSupperClass::SetMapScale(theMapScale);
if ( myIsContour ) {
vtkFloatingPointType aRange[2];
#ifndef VISU_Plot3DPL_HeaderFile
#define VISU_Plot3DPL_HeaderFile
-#include "VISU_ScalarMapPL.hxx"
+#include "VISU_PrsMergerPL.hxx"
#include "VISU_CutPlanesPL.hxx"
class vtkWarpScalar;
class vtkGeometryFilter;
class vtkCellDataToPointData;
-class VISU_Plot3DPL : public VISU_ScalarMapPL{
+class VISU_Plot3DPL : public VISU_PrsMergerPL{
+ typedef VISU_ScalarMapPL TSupperClass;
protected:
VISU_Plot3DPL();
VISU_Plot3DPL(const VISU_Plot3DPL&);
public:
- vtkTypeMacro(VISU_Plot3DPL,VISU_ScalarMapPL);
+ vtkTypeMacro(VISU_Plot3DPL,TSupperClass);
static VISU_Plot3DPL* New();
virtual ~VISU_Plot3DPL();
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File: VISU_PrsMergerPL.cxx
+// Author: Eugeny Nikolaev
+// Module : VISU
+
+#include "VISU_PrsMergerPL.hxx"
+#include "VISU_MeshPL.hxx"
+#include "VISU_ScalarMapPL.hxx"
+#include "VISU_MergeFilter.hxx"
+#include "VISU_IDMapper.hxx"
+#include "VTKViewer_AppendFilter.h"
+
+#include "VISU_PipeLineUtils.hxx"
+
+#include <vtkMapper.h>
+#include <vtkDataSet.h>
+#include <vtkObjectFactory.h>
+#include <vtkMergeFilter.h>
+#include <vtkDataSetMapper.h>
+#include <vtkUnstructuredGrid.h>
+#include <vtkObject.h>
+#include <vtkFloatArray.h>
+#include <vtkPointData.h>
+#include <vtkCellData.h>
+#include <vtkCellType.h>
+#include <vtkCell.h>
+
+#include <vector>
+#include <set>
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+
+using namespace std;
+
+vtkStandardNewMacro(VISU_PrsMergerPL);
+
+VISU_PrsMergerPL
+::VISU_PrsMergerPL()
+{
+ myScalars = NULL;
+
+ //myMergeFilter->Delete();
+ myMeshGeometryList.clear();
+}
+
+VISU_PrsMergerPL
+::~VISU_PrsMergerPL()
+{
+ myMeshGeometryList.clear();
+}
+
+void
+VISU_PrsMergerPL
+::RemoveAllGeom()
+{
+ myMeshGeometryList.clear();
+ this->Execute();
+}
+
+void
+VISU_PrsMergerPL
+::ShallowCopy(VISU_PipeLine *thePipeLine)
+{
+ VISU_PrsMergerPL* aPipeLine = dynamic_cast<VISU_PrsMergerPL*>(thePipeLine);
+ if(this == aPipeLine){
+ TSupperClass::ShallowCopy(thePipeLine);
+ return;
+ }
+ if(aPipeLine){
+ int aNbGeoms = aPipeLine->GetNbGeometry();
+ if (MYDEBUG) MESSAGE("aNbGeoms="<<aNbGeoms);
+ myMeshGeometryList.clear();
+ for(int i=0; i<aNbGeoms; i++){
+ AddBackGeometry(aPipeLine->GetGeometry(i),false);
+ }
+ SetScalars(aPipeLine->GetScalars(),true);
+ }
+ TSupperClass::ShallowCopy(thePipeLine);
+}
+
+bool
+VISU_PrsMergerPL
+::SetGeometry(VISU_PipeLine* theGeometry,bool theUpdate)
+{
+ myMeshGeometryList.clear();
+ if(this->checkGeometry(theGeometry)){
+ myMeshGeometryList.push_back(theGeometry);
+ if (MYDEBUG) MESSAGE("this->GetGeometry(0)->GetIDMapper()="<<this->GetGeometry(0)->GetIDMapper());
+
+ if(theUpdate)
+ this->Execute();
+
+ return true;
+ } else
+ return false;
+
+}
+
+int
+VISU_PrsMergerPL
+::AddBackGeometry(VISU_PipeLine* theGeometry,bool theUpdate)
+{
+ if(theGeometry == NULL) return -1;
+ int aGeomNum = this->GetGeometryNumber(theGeometry);
+ if(aGeomNum == -1){
+ bool aCheckGeom = this->checkGeometry(theGeometry);
+ if(aCheckGeom){
+ myMeshGeometryList.push_back(theGeometry);
+
+ if(theUpdate)
+ this->Execute();
+
+ return (myMeshGeometryList.size()-1);
+ } else {
+ return -1;
+ }
+ } else {
+ return aGeomNum;
+ }
+}
+
+int
+VISU_PrsMergerPL
+::GetGeometryNumber(VISU_PipeLine* theGeometry)
+{
+ TPipeLine aPipeLine = theGeometry;
+ TPipeLines::const_iterator aIter = myMeshGeometryList.begin();
+ for(int i=0;aIter != myMeshGeometryList.end();aIter++,i++){
+ if( theGeometry == (*aIter).GetPointer() )
+ return i;
+ }
+
+ return -1;
+}
+
+void
+VISU_PrsMergerPL
+::RemoveGeometryById(int theId)
+{
+ if(theId >=0 && theId < myMeshGeometryList.size()){
+ TPipeLines::iterator aIter = myMeshGeometryList.begin();
+ for(;aIter != myMeshGeometryList.end();aIter++){
+ if( myMeshGeometryList[theId] == (*aIter)){
+ myMeshGeometryList.erase(aIter);
+ this->Execute();
+ break;
+ }
+ }
+ }
+}
+
+VISU_PipeLine*
+VISU_PrsMergerPL
+::GetGeometry(int theId)
+{
+ if(theId >=0 && theId < myMeshGeometryList.size()){
+ return myMeshGeometryList[theId].GetPointer();
+ }
+ else
+ return NULL;
+}
+
+VISU_PipeLine*
+VISU_PrsMergerPL
+::GetScalars()
+{
+ return myScalars.GetPointer();
+}
+
+int
+VISU_PrsMergerPL
+::GetNbGeometry()
+{
+ return myMeshGeometryList.size();
+}
+
+bool
+VISU_PrsMergerPL
+::SetScalars(VISU_PipeLine* theInput,bool theUpdate)
+{
+ if(MYDEBUG) MESSAGE("VISU_PrsMergerPL::SetScalars()");
+ if ( this->checkScalars( theInput ) ){
+ myScalars = theInput;
+ VISU_ScalarMapPL* aScalarMap = dynamic_cast<VISU_ScalarMapPL*>(this->GetScalars());
+ myScalarRanges = aScalarMap->GetScalarRange();
+ if(theUpdate)
+ this->Execute();
+ return true;
+ } else
+ return false;
+}
+
+void
+VISU_PrsMergerPL
+::Init()
+{
+ Superclass::Init();
+ if(MYDEBUG) MESSAGE("VISU_PrsMergerPL::Init() this="<<this);
+ this->Execute();
+}
+
+void
+VISU_PrsMergerPL
+::Update()
+{
+ if(MYDEBUG) MESSAGE("VISU_PrsMergerPL::Update()");
+ Superclass::Update();
+}
+
+void
+VISU_PrsMergerPL
+::Build()
+{
+ if(MYDEBUG) MESSAGE("VISU_PrsMergerPL::Build()");
+ TSupperClass::Build(); // call DoHook method
+}
+
+void
+VISU_PrsMergerPL
+::SetInitialRange()
+{
+ myMapper->UseLookupTableScalarRangeOff();
+}
+
+bool
+VISU_PrsMergerPL
+::checkGeometry(const VISU_PipeLine* thePipeLine)
+{
+ const VISU::PIDMapper& aMapper = thePipeLine->GetIDMapper();
+ int aNbPoints = aMapper->GetVTKOutput()->GetNumberOfPoints();
+ if (this->GetNbGeometry() > 0){
+ const VISU::PIDMapper& aMapper2 = this->GetGeometry(0)->GetIDMapper();
+ int aNbPoints2 = aMapper2->GetVTKOutput()->GetNumberOfPoints();
+ if(aNbPoints2 != aNbPoints)
+ return false;
+ } else if (this->GetScalars()) {
+ const VISU::PIDMapper& aMapper2 = this->GetScalars()->GetIDMapper();
+ int aNbPoints2 = aMapper2->GetVTKOutput()->GetNumberOfPoints();
+ if(aNbPoints2 != aNbPoints)
+ return false;
+ }
+ return true;
+}
+
+bool
+VISU_PrsMergerPL
+::checkScalars(const VISU_PipeLine* thePipeLine)
+{
+ const VISU::PIDMapper& aMapper = thePipeLine->GetIDMapper();
+ int aNbPoints = aMapper->GetVTKOutput()->GetNumberOfPoints();
+ if (this->GetNbGeometry() > 0){
+ const VISU::PIDMapper& aMapper2 = this->GetGeometry(0)->GetIDMapper();
+ int aNbPoints2 = aMapper2->GetVTKOutput()->GetNumberOfPoints();
+ if(aNbPoints2 != aNbPoints)
+ return false;
+ }
+ return true;
+}
+
+void
+VISU_PrsMergerPL
+::Execute(){
+ /* Where are next situations:
+ * 1. Timestamp on entity=NODE
+ * 1.1 Group Cell - OK
+ * 1.2 Group Cell + Point - ERR (remove points groups)
+ * 1.3 Group Node - ERR (remove points groups)
+ * 2. Timesatamp on entity=CELL
+ * 2.1 Group Cell - OK
+ * 2.2 Group Point - ERR (remove points groups)
+ */
+
+
+
+ if(MYDEBUG) MESSAGE("VISU_PrsMergerPL::Execute()");
+
+ if(myMeshGeometryList.size() != 0)
+ {
+
+ typedef std::vector<int> TVec;
+
+ vtkUnstructuredGrid* output = vtkUnstructuredGrid::New();
+ TVec aObjIds; // vector with object ids
+ vtkFloatArray* newArray = vtkFloatArray::New();
+
+ VISU_ScalarMapPL* aScalarMap = dynamic_cast<VISU_ScalarMapPL*>(this->GetScalars());
+ const VISU::PIDMapper& aScalarMapper = myScalars->GetIDMapper();
+
+ // copy points to output from input scalar map
+ output->SetPoints(aScalarMapper->GetVTKOutput()->GetPoints());
+
+ int newCellId;
+ int anbGeoms = this->GetNbGeometry();
+ for(int i=0; i < anbGeoms; i++) {
+ VISU_PipeLine* aCurrGeometry = this->GetGeometry(i);
+ const VISU::PIDMapper& aGM = aCurrGeometry->GetIDMapper();
+ int aNbCells = aGM->GetVTKOutput()->GetNumberOfCells();
+ if (aNbCells >0 )
+ if (aGM->GetVTKOutput()->GetCell(0)->GetCellType() == VTK_VERTEX )
+ continue;
+
+ vtkIdList* ptIds = vtkIdList::New();
+ ptIds->Allocate(VTK_CELL_SIZE);
+
+ for(int j=0; j < aNbCells; j++){
+
+ int anObjID = aGM->GetElemObjID(j);
+ aObjIds.push_back(anObjID);
+
+ // copy cells to output from input geoms
+ aGM->GetVTKOutput()->GetCellPoints(j, ptIds);
+ newCellId = output->InsertNextCell(aGM->GetVTKOutput()->GetCellType(j),ptIds);
+ }
+ ptIds->Delete();
+ }
+
+
+ //copy array values
+ vtkDataArray* da;
+ if((da = aScalarMapper->GetVTKOutput()->GetPointData()->GetArray("VISU_FIELD"))){
+ output->GetPointData()->AddArray(da);
+ vtkDataArray* vc = aScalarMapper->GetVTKOutput()->GetPointData()->GetVectors();
+ if(vc)
+ output->GetPointData()->SetVectors(vc);
+ }
+ if((da = aScalarMapper->GetVTKOutput()->GetCellData()->GetArray("VISU_FIELD"))){
+ if(MYDEBUG){
+ MESSAGE("aScalarMapper NumberOfComponents="<<da->GetNumberOfComponents());
+ MESSAGE("aScalarMapper NumberOfTuples ="<<da->GetNumberOfTuples());
+ }
+
+ newArray->SetNumberOfComponents(da->GetNumberOfComponents());
+ newArray->SetNumberOfTuples(aObjIds.size());
+ newArray->SetName("VISU_FIELD");
+
+ TVec::const_iterator aIdsIter = aObjIds.begin();
+ for(int i=0; aIdsIter != aObjIds.end(); aIdsIter++){
+ int anObjID = *aIdsIter;
+ int aVTKID = aScalarMapper->GetElemVTKID(anObjID);
+ newArray->SetTuple(i,da->GetTuple(aVTKID));
+ i++;
+ }
+ output->GetCellData()->AddArray(newArray);
+
+ // need in vectors array and scalars array
+ if(vtkDataArray* vc = aScalarMapper->GetVTKOutput()->GetCellData()->GetVectors()){
+ output->GetCellData()->SetVectors(newArray);
+ }
+ else if(vtkDataArray* sc = aScalarMapper->GetVTKOutput()->GetCellData()->GetScalars())
+ output->GetCellData()->SetScalars(newArray);
+ }
+
+ if(MYDEBUG){
+ MESSAGE("output:");
+ output->Print(cout);
+ }
+
+
+ SetInput(output);
+
+ output->Delete();
+ newArray->Delete();
+ }
+ else
+ {
+ if(myScalars != NULL)
+ {
+ VISU_ScalarMapPL* aScalarMap = dynamic_cast<VISU_ScalarMapPL*>(this->GetScalars());
+ VISU_PrsMergerPL* aPrsMerger = dynamic_cast<VISU_PrsMergerPL*>(this->GetScalars());
+ if(aScalarMap != NULL){
+ SetInput(aScalarMap->GetInput());
+ }
+ }
+ }
+}
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File: VISU_PrsMergerPL.hxx
+// Author: Eugeny Nikolaev
+// Module : VISU
+
+#ifndef VISU_PrsMergerPL_HeaderFile
+#define VISU_PrsMergerPL_HeaderFile
+
+#include "VISU_ScalarMapPL.hxx"
+
+class VISU_PrsMergerPL : public VISU_ScalarMapPL
+{
+ typedef VISU_ScalarMapPL TSupperClass;
+
+protected:
+ VISU_PrsMergerPL();
+ VISU_PrsMergerPL(const VISU_PrsMergerPL&);
+
+ virtual
+ ~VISU_PrsMergerPL();
+
+public:
+
+ typedef TVTKSmartPtr<VISU_PipeLine> TPipeLine;
+ typedef std::vector<TPipeLine> TPipeLines;
+
+ vtkTypeMacro(VISU_PrsMergerPL,TSupperClass);
+
+ static
+ VISU_PrsMergerPL*
+ New();
+
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
+
+ /*!
+ * Add geometry of presentation to myMeshGeometryList.
+ * \params theGeometry - visu pipeline with geometry.
+ * \params theUpdate - update pipeline if true.
+ * \retval TRUE - if geometry and scalars on the common mesh, esle FALSE.
+ */
+ virtual
+ bool
+ SetGeometry(VISU_PipeLine* theGeometry,bool theUpdate=true);
+
+ /*!
+ * Add geometry to back of myMeshGeometryList.
+ * \params theInput - visu pipeline with geometry.
+ * \params theUpdate - update pipeline if true.
+ * \retval index of added geometry. (must be >= 0)
+ * \retval -1, if geometry not added.
+ */
+ virtual
+ int
+ AddBackGeometry(VISU_PipeLine* theGeometry,bool theUpdate=true);
+
+ /*!
+ * Get geometry id of myMeshGeometryList.
+ * \retval index of geometry. (must be >= 0)
+ * \retval -1 - if geometry not exists.
+ */
+ virtual
+ int
+ GetGeometryNumber(VISU_PipeLine* theGeometry);
+
+ /*!
+ * Remove geometry with id = theId from myMeshGeometryList.
+ * the id in [0,...]
+ */
+ virtual
+ void
+ RemoveGeometryById(int theId);
+
+ /*! Removes all geometries.
+ */
+ virtual
+ void
+ RemoveAllGeom();
+
+ /*!
+ * Gets geometry of presentation by id.
+ * \retval VISU_MeshPL - pointer
+ * the id in [0,...]
+ */
+ virtual
+ VISU_PipeLine*
+ GetGeometry(int theId=0);
+
+ /*!
+ * Gets number of geometrys
+ * \retval int - number
+ */
+ virtual
+ int
+ GetNbGeometry();
+
+ /*!
+ * Sets scalar values and ids by VISU_ScalarMapPL object.
+ * \params theInput - visu pipeline with scalar values
+ * \params theUpdate - update pipeline if true.
+ * \retval TRUE - if scalars and geometry on the common mesh, esle FALSE.
+ */
+ virtual
+ bool
+ SetScalars(VISU_PipeLine* theInput,bool theUpdate=false);
+
+ /*!
+ * Gets input VISU_ScalarMapPL, which contain scalar values and ids.
+ */
+ virtual
+ VISU_PipeLine*
+ GetScalars();
+
+ virtual
+ void
+ Init();
+
+ virtual
+ void
+ Build();
+
+ /*!
+ * Calculate presentation, by merging of Geometry and Scalar Values.
+ */
+ virtual
+ void
+ Update();
+
+ /*!
+ * Set ranges of scalar values by input myScalars ranges.
+ */
+ void SetInitialRange();
+
+protected:
+ TPipeLines myMeshGeometryList;
+
+ TPipeLine myScalars;
+
+ vtkFloatingPointType* myScalarRanges;
+
+private:
+
+ /*!
+ * Check if thePipeLine and "first element of list myMeshGeometryList" or
+ * "myScalars", has
+ * common DataPoints (simple check number of points).
+ * \retval TRUE - if has common points, esle FALSE.
+ */
+ bool
+ checkGeometry(const VISU_PipeLine* thePipeLine);
+
+
+ /*!
+ * Check if thePipeLine and first element of list myMeshGeometryList, has
+ * common DataPoints (simple check number of points).
+ * \retval TRUE - if has common points, esle FALSE.
+ */
+ bool
+ checkScalars(const VISU_PipeLine* thePipeLine);
+
+ void
+ Execute();
+
+};
+
+#endif
VISU_ScalarMapOnDeformedShapePL
::Init()
{
- if (GetScalars() == NULL) SetScalars(GetInput2());
+ if (GetScalarsUnstructuredGrid() == NULL) SetScalars(GetInput2());
Superclass::Init();
VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine);
if(aPipeLine){
SetScale(aPipeLine->GetScale());
- SetScalars(aPipeLine->GetScalars());
+ SetScalars(aPipeLine->GetScalarsUnstructuredGrid());
vtkFloatingPointType aRange[2];
aPipeLine->GetSourceRange(aRange);
SetScalarRange(aRange);
::SetScalars(vtkDataSet *theScalars)
{
myScalars = theScalars;
- vtkUnstructuredGrid* aScalars = GetScalars();
+ vtkUnstructuredGrid* aScalars = GetScalarsUnstructuredGrid();
vtkCellData *aInCellData = GetInput()->GetCellData();
if(aScalars->GetPointData()->GetScalars())
*/
vtkUnstructuredGrid*
VISU_ScalarMapOnDeformedShapePL
-::GetScalars()
+::GetScalarsUnstructuredGrid()
{
return myScalars.GetPointer();
}
#ifndef VISU_ScalarMapOnDeformedShapePL_HeaderFile
#define VISU_ScalarMapOnDeformedShapePL_HeaderFile
-#include "VISU_ScalarMapPL.hxx"
+#include "VISU_PrsMergerPL.hxx"
class vtkMergeFilter;
class vtkWarpVector;
class vtkCellDataToPointData;
class vtkPointDataToCellData;
-class VISU_ScalarMapOnDeformedShapePL : public VISU_ScalarMapPL
+class VISU_ScalarMapOnDeformedShapePL : public VISU_PrsMergerPL
{
protected:
VISU_ScalarMapOnDeformedShapePL();
VISU_ScalarMapOnDeformedShapePL(const VISU_ScalarMapOnDeformedShapePL&);
public:
- vtkTypeMacro(VISU_ScalarMapOnDeformedShapePL,VISU_ScalarMapPL);
+ vtkTypeMacro(VISU_ScalarMapOnDeformedShapePL,VISU_PrsMergerPL);
static VISU_ScalarMapOnDeformedShapePL* New();
virtual void GetSourceRange(vtkFloatingPointType theRange[2]);
virtual void SetScalars(vtkDataSet *theScalars);
- virtual vtkUnstructuredGrid* GetScalars();
+ virtual vtkUnstructuredGrid* GetScalarsUnstructuredGrid();
public:
//! Redefined method for initialization of the pipeline.
VISU_StreamLinesPL
::Init()
{
- VISU_ScalarMapPL::Init();
+ VISU_PrsMergerPL::Init();
vtkPointSet* aDataSet = myExtractor->GetOutput();
vtkFloatingPointType anIntStep = GetBaseIntegrationStep(aDataSet);
vtkFloatingPointType aPropagationTime = GetBasePropagationTime(aDataSet);
VISU_StreamLinesPL
::Update()
{
- VISU_ScalarMapPL::Update();
+ VISU_PrsMergerPL::Update();
}
void
msgstr "Visu_isosurfaces.png"
msgid "ICON_CUT_PLANES"
-msgstr "Visu_cutplane.png"
+msgstr "Visu_cutplanes.png"
msgid "ICON_CUT_LINES"
msgstr "Visu_cutlines.png"
msgid "ICON_PLOT2D"
msgstr "Visu_plot2d.png"
+# Tree icons for presentations
+
+msgid "ICON_TREE_RESULT"
+msgstr "Visu_tree_result.png"
+
+msgid "ICON_TREE_TABLE"
+msgstr "Visu_tree_table.png"
+
+msgid "ICON_TREE_CURVE"
+msgstr "Visu_tree_curve.png"
+
+msgid "ICON_TREE_CONTAINER"
+msgstr "Visu_tree_container.png"
+
+msgid "ICON_TREE_MESH"
+msgstr "Visu_tree_mesh.png"
+
+msgid "ICON_TREE_SCALAR_MAP"
+msgstr "Visu_tree_scalars.png"
+
+msgid "ICON_TREE_SCALAR_MAP_GROUPS"
+msgstr "Visu_tree_scalars_gr.png"
+
+msgid "ICON_TREE_DEFORMED_SHAPE"
+msgstr "Visu_tree_deformed.png"
+
+msgid "ICON_TREE_DEFORMED_SHAPE_GROUPS"
+msgstr "Visu_tree_deformed_gr.png"
+
+msgid "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE"
+msgstr "Visu_tree_scalarmapondeformedshape.png"
+
+msgid "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE_GROUPS"
+msgstr "Visu_tree_scalarmapondeformedshape_gr.png"
+
+msgid "ICON_TREE_VECTORS"
+msgstr "Visu_tree_vectors.png"
+
+msgid "ICON_TREE_VECTORS_GROUPS"
+msgstr "Visu_tree_vectors_gr.png"
+
+msgid "ICON_TREE_ISO_SURFACES"
+msgstr "Visu_tree_isosurfaces.png"
+
+msgid "ICON_TREE_ISO_SURFACES_GROUPS"
+msgstr "Visu_tree_isosurfaces_gr.png"
+
+msgid "ICON_TREE_CUT_PLANES"
+msgstr "Visu_tree_cutplanes.png"
+
+msgid "ICON_TREE_CUT_PLANES_GROUPS"
+msgstr "Visu_tree_cutplanes_gr.png"
+
+msgid "ICON_TREE_CUT_LINES"
+msgstr "Visu_tree_cutlines.png"
+
+msgid "ICON_TREE_CUT_LINES_GROUPS"
+msgstr "Visu_tree_cutlines_gr.png"
+
+msgid "ICON_TREE_STREAM_LINES"
+msgstr "Visu_tree_streamlines.png"
+
+msgid "ICON_TREE_STREAM_LINES_GROUPS"
+msgstr "Visu_tree_streamlines_gr.png"
+
+msgid "ICON_TREE_PLOT_3D"
+msgstr "Visu_tree_plot3d.png"
+
+msgid "ICON_TREE_PLOT_3D_GROUPS"
+msgstr "Visu_tree_plot3d_gr.png"
+
+msgid "ICON_TREE_GAUSS_POINTS"
+msgstr "Visu_tree_gauss_points.png"
+
# Representation menu
msgid "ICON_POINTS"
msgid "ICON_LOAD_TEXTURE"
msgstr "Visu_load_texture.png"
+
+msgid "ICON_ADD"
+msgstr "Visu_add.png"
+
+msgid "ICON_REMOVE"
+msgstr "Visu_remove.png"
msgid "VISU_PREF_SECOND_TAB"
msgstr "Scalar range, Sweep, MED import, Shading"
+msgid "PRS_ON_GROUPS"
+msgstr "Build presentation on groups"
+
+msgid "NO_GROUPS"
+msgstr "No groups in the mesh"
+
msgid "VISU_SCALAR_RANGE"
msgstr "Scalar range"
#include "VisuGUI_BuildProgressDlg.h"
#include "VisuGUI_TransparencyDlg.h"
-#include "VISU_ScalarMap_i.hh"
+#include "VISU_PrsMerger_i.hh"
#include "VisuGUI_ScalarBarDlg.h"
#include "VISU_DeformedShape_i.hh"
VisuGUI::
OnCreateScalarMap()
{
- CreatePrs3d<VISU::ScalarMap_i,VisuGUI_ScalarBarDlg,1>(this);
+ CreatePrs3d<VISU::PrsMerger_i,VisuGUI_ScalarBarDlg,1>(this);
}
{
Handle(SALOME_InteractiveObject) anIO;
if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
- EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg, 1>(this, anIO, aPrs3d);
+ EditPrs3d<VISU::PrsMerger_i, VisuGUI_ScalarBarDlg, 1>(this, anIO, aPrs3d);
}
void
aSameMesh->SameAs(aMeshPrs);
}
break;
- case VISU::TSCALARMAP:
+ case VISU::TPRSMERGER:
{
- VISU::ScalarMap_i* aScalarPrs = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
- VISU::ScalarMap_i* aSameScalar = new VISU::ScalarMap_i(aScalarPrs->GetResult(),true);
+ VISU::PrsMerger_i* aScalarPrs = dynamic_cast<VISU::PrsMerger_i*>(aPrsObject);
+ VISU::PrsMerger_i* aSameScalar = new VISU::PrsMerger_i(aScalarPrs->GetResult(),true);
aSameScalar->SameAs(aScalarPrs);
}
break;
// Rules
- QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
+ QString aPrsAll ("'VISU::TPRSMERGER' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
"'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE'");
// VISU root commands
// 3D presentations commands
QString aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
- QString aInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE'}";
- QString aSurfFrameType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
- QString aSurfType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
+ QString aInsideType = " and $type in {'VISU::TMESH' 'VISU::TPRSMERGER' 'VISU::TDEFORMEDSHAPE'}";
+ QString aSurfFrameType = " and $type in {'VISU::TMESH' 'VISU::TPRSMERGER''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
+ QString aSurfType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TPRSMERGER' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
" 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
- QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' "
+ QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TPRSMERGER' 'VISU::TISOSURFACE' "
"'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
- QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
+ QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TPRSMERGER' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
"'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' }";
aRule = "selcount=1";
mgr->setRule( action( VISU_CLEAR_CONTAINER ), aRule, true );
mgr->setRule( action( VISU_EDIT_SCALARMAP ),
- "selcount=1 and type='VISU::TSCALARMAP'", true );
+ "selcount=1 and type='VISU::TPRSMERGER'", true );
mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
"selcount=1 and type='VISU::TDEFORMEDSHAPE'", true );
mgr->setRule( action( VISU_EDIT_SCALARMAPONDEFORMEDSHAPE ),
aRule = "client='ObjectBrowser' and $type in {'VISU::TENTITY' 'VISU::TFAMILY' 'VISU::TGROUP'}";
mgr->setRule( action( VISU_CREATE_PRS ), aRule + " and selcount=1", true );
mgr->setRule( action( VISU_CREATE_MANY_PRS ), aRule + " and selcount>1", true );
+ mgr->setRule( action( VISU_EDIT_PLOT3D ),
+ "selcount=1 and type='VISU::TPLOT3D'", true );
//aRule = "client='ObjectBrowser' and type='MEDFIELD'";
//mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
ENUM2STRING( aResStr, VISU::TCURVE );
ENUM2STRING( aResStr, VISU::TCONTAINER );
ENUM2STRING( aResStr, VISU::TMESH );
- ENUM2STRING( aResStr, VISU::TSCALARMAP );
+ ENUM2STRING( aResStr, VISU::TPRSMERGER );
ENUM2STRING( aResStr, VISU::TISOSURFACE );
ENUM2STRING( aResStr, VISU::TDEFORMEDSHAPE );
ENUM2STRING( aResStr, VISU::TSCALARMAPONDEFORMEDSHAPE );
#include "VISUConfig.hh"
#include "VISU_Convertor.hxx"
-#include "VISU_ScalarMapPL.hxx"
-#include "VISU_ScalarMap_i.hh"
#include "VISU_ScalarMapAct.h"
+#include "VISU_Result_i.hh"
#include "LightApp_Application.h"
#include <vtkTextProperty.h>
+using namespace VISU;
using namespace std;
setSpacing(6);
//setMargin(11);
+ // Presentation type ================================================
+ myMainGroupBox = new QGroupBox(tr(""), this, "myMainGroupBox");
+ myMainGroupBox->setColumnLayout(0, Qt::Vertical );
+ myMainGroupBox->layout()->setSpacing( 0 );
+ myMainGroupBox->layout()->setMargin( 0 );
+ QGridLayout* aMainGroupBoxLayout = new QGridLayout( myMainGroupBox->layout() );
+ myMainGroupBox->setAlignment( Qt::AlignTop );
+ aMainGroupBoxLayout->setSpacing( 6 );
+ aMainGroupBoxLayout->setMargin( 11 );
+
+ myOnGroupsCB = new QCheckBox (tr("PRS_ON_GROUPS"), myMainGroupBox);
+ myOnGroupsCB->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ // Lists of groups and add/remove buttons
+ QPixmap addImage ( aResourceMgr->loadPixmap("VISU", tr("ICON_ADD")));
+ QPixmap removeImage ( aResourceMgr->loadPixmap("VISU", tr("ICON_REMOVE")));
+
+ myAllGroups = new VisuGUI_ListBox(myMainGroupBox, "myAllGroups");
+ myAllGroups->setSelectionMode(QListBox::Extended);
+
+ myAddButton = new QToolButton(myMainGroupBox);
+ myAddButton->setPixmap( addImage );
+
+ myRemoveButton = new QToolButton(myMainGroupBox);
+ myRemoveButton->setPixmap( removeImage );
+
+ mySelectedGroups = new VisuGUI_ListBox(myMainGroupBox, "mySelectedGroups");
+ mySelectedGroups->setSelectionMode(QListBox::Extended);
+
+ // Layouting
+ QVBoxLayout* buttonsLayout = new QVBoxLayout();
+ buttonsLayout->addWidget(myAddButton);
+ buttonsLayout->addSpacing(6);
+ buttonsLayout->addWidget(myRemoveButton);
+ buttonsLayout->addStretch();
+
+ aMainGroupBoxLayout->addMultiCellWidget( myOnGroupsCB, 0, 0, 0, 2);
+ aMainGroupBoxLayout->addWidget( myAllGroups, 1, 0 );
+ aMainGroupBoxLayout->addLayout( buttonsLayout, 1, 1 );
+ aMainGroupBoxLayout->addWidget( mySelectedGroups, 1, 2 );
+ aMainGroupBoxLayout->setRowStretch(1, 10);
+
+ mySelectedGroups->installEventFilter(this);
+
// Range ============================================================
RangeGroup = new QButtonGroup (tr("SCALAR_RANGE_GRP"), this, "RangeGroup");
RangeGroup->setColumnLayout(0, Qt::Vertical );
CheckGroupLayout->addWidget(myPreviewCheck , 0, 0 );
// signals and slots connections ===========================================
+ connect( myOnGroupsCB, SIGNAL( toggled( bool ) ), this, SLOT( onTypeChanged() ) );
+ connect( myAllGroups, SIGNAL( doubleClicked( QListBoxItem* ) ), this, SLOT( onListDoubleClicked( QListBoxItem* ) ) );
+ connect( mySelectedGroups, SIGNAL( doubleClicked( QListBoxItem* ) ), this, SLOT( onListDoubleClicked( QListBoxItem* ) ) );
+ connect( myAddButton, SIGNAL(clicked()), this, SLOT(onAdd()));
+ connect( myRemoveButton, SIGNAL(clicked()), this, SLOT(onRemove()));
connect( RangeGroup, SIGNAL( clicked( int ) ), this, SLOT( changeRange( int ) ) );
connect( myModeCombo, SIGNAL( activated( int ) ), this, SLOT( changeScalarMode( int ) ) );
connect( OrientGroup, SIGNAL( clicked( int ) ), this, SLOT( changeDefaults( int ) ) );
connect( WidthSpin, SIGNAL( valueChanged( double ) ), this, SLOT( updatePreview() ));
connect( HeightSpin, SIGNAL( valueChanged( double ) ), this, SLOT( updatePreview() ));
connect( CBLog, SIGNAL( toggled( bool ) ), this, SLOT( updatePreview() ));
+ onTypeChanged();
changeRange( 0 );
changeDefaults( 0 );
myIsStoreTextProp = false;
/**
* Initialise dialog box from presentation object
*/
-void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) {
+void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::PrsMerger_i* thePrs) {
initFromResources();
myScalarMap = thePrs;
+
+ // type of presentation and groups
+ VISU::Result_i* theResult = myScalarMap->GetResult();
+ VISU_Convertor* aInput = theResult->GetInput();
+
+ const VISU::TMeshMap& aMeshMap = aInput->GetMeshMap();
+
+ VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.find(thePrs->GetMeshName());
+ if(aMeshIter!=aMeshMap.end()){
+ const PMesh& aMesh = aMeshIter->second;
+ const TGroupMap& aGroupMap = aMesh->myGroupMap;
+ TGroupMap::const_iterator aGroupIter = aGroupMap.begin();
+ for(;aGroupIter!=aGroupMap.end();aGroupIter++)
+ {
+ const string& aGroupName = aGroupIter->first;
+ if(thePrs->CheckGroup(&aGroupName[0]))
+ myAllGroups->insertItem( QString(aGroupName) );
+ }
+ }
+
+ if (myAllGroups->count() < 1)
+ {
+ myAllGroups->insertItem( tr("NO_GROUPS") );
+ myMainGroupBox->setEnabled(false);
+ }
+ else
+ {
+ // Get names of the groups
+ string_array_var aGroupNames = thePrs->getGroupNames();
+ for(int i=0; i<aGroupNames->length(); i++)
+ mySelectedGroups->insertItem( QString(aGroupNames[i]) );
+
+ if (mySelectedGroups->count() > 0)
+ myOnGroupsCB->setChecked(true);
+ }
+
+ //
myTitle = thePrs->GetTitle();
setPosAndSize( thePrs->GetPosX(),
thePrs->GetPosY(),
setLogarithmic(false);
}
vtkFloatingPointType aRange[2];
- thePrs->GetScalarMapPL()->GetSourceRange(aRange);
+ thePrs->GetPrsMergerPL()->GetSourceRange(aRange);
Rmin = aRange[0]; Rmax = aRange[1];
setRange( thePrs->GetMin(), thePrs->GetMax(),
/*0.0, 0.0,*/ thePrs->IsRangeFixed() );
if (myScalarMap == NULL) return;
if (!check()) return;
- myScalarMapPL = VISU_ScalarMapPL::New();
- if(myScalarMap->GetScalarMapPL())
- myScalarMapPL->ShallowCopy(myScalarMap->GetScalarMapPL());
+ myScalarMapPL = VISU_PrsMergerPL::New();
+ if(myScalarMap->GetPrsMergerPL())
+ myScalarMapPL->ShallowCopy(myScalarMap->GetPrsMergerPL());
if ( myBusy ) return;
if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
vf->Repaint();
}
+
+/*!
+ Event filter
+*/
+bool VisuGUI_ScalarBarPane::eventFilter (QObject* object, QEvent* event)
+{
+ if (event->type() == QEvent::KeyPress) {
+ QKeyEvent* aKeyEvent = (QKeyEvent*)event;
+ if (object == mySelectedGroups && aKeyEvent->key() == Key_Delete)
+ onRemove();
+ }
+ return QObject::eventFilter(object, event);
+}
+
/**
* Store values to presentation object
*/
-int VisuGUI_ScalarBarPane::storeToPrsObject(VISU::ScalarMap_i* thePrs) {
+int VisuGUI_ScalarBarPane::storeToPrsObject(VISU::PrsMerger_i* thePrs) {
+ thePrs->RemoveAllGeom();
+
+ if (myOnGroupsCB->isChecked())
+ {
+ QString aMeshName = thePrs->GetMeshName();
+ for (int i = 0; i < mySelectedGroups->count(); i++)
+ thePrs->AddMeshOnGroup( aMeshName , mySelectedGroups->text(i) );
+ }
+
thePrs->SetScalarMode(myModeCombo->currentItem());
thePrs->SetPosition(XSpin->value(), YSpin->value());
thePrs->SetSize(WidthSpin->value(), HeightSpin->value());
return 1;
}
+/*!
+ Called when the checkbox is toggled
+*/
+void VisuGUI_ScalarBarPane::onTypeChanged( )
+{
+ bool toEnable = myOnGroupsCB->isChecked();
+ if (!toEnable)
+ {
+ myAllGroups->clearSelection();
+ mySelectedGroups->clearSelection();
+ }
+ myAllGroups->setEnabled( toEnable );
+ mySelectedGroups->setEnabled( toEnable );
+ myAddButton->setEnabled( toEnable );
+ myRemoveButton->setEnabled( toEnable );
+}
+
+/*!
+ Called when add button is clicked, adds item to choosen groups
+*/
+void VisuGUI_ScalarBarPane::onAdd()
+{
+ QStringList aList;
+
+ for (int i = 0; i < myAllGroups->count(); i++)
+ if (myAllGroups->isSelected(i))
+ aList.append(myAllGroups->text(i));
+
+ for (int i = 0; i < mySelectedGroups->count(); i++)
+ aList.remove(mySelectedGroups->text(i));
+
+ mySelectedGroups->insertStringList(aList);
+}
+
+/*!
+ Called when remove button is clicked, remove selected items from choosen
+*/
+void VisuGUI_ScalarBarPane::onRemove()
+{
+ QPtrList<QListBoxItem> aList;
+ aList.setAutoDelete(false);
+ for (int i = 0; i < mySelectedGroups->count(); i++)
+ if (mySelectedGroups->isSelected(i))
+ aList.append(mySelectedGroups->item(i));
+
+ for (int i = 0; i < aList.count(); i++)
+ delete aList.at(i);
+}
+
+/*!
+ Called when an item of listbox is double-clicked
+*/
+void VisuGUI_ScalarBarPane::onListDoubleClicked( QListBoxItem* theItem )
+{
+ QListBox* aListBox = theItem->listBox();
+
+ if (aListBox == myAllGroups)
+ {
+ if (!mySelectedGroups->findItem( theItem->text(), Qt::ExactMatch ))
+ mySelectedGroups->insertItem(theItem->text());
+ }
+ else if (aListBox == mySelectedGroups)
+ delete theItem;
+}
+
/*!
Called when orientation is changed
*/
vtkFloatingPointType aRange[2];
int aMode = myScalarMap->GetScalarMode();
myScalarMap->SetScalarMode(theMode);
- myScalarMap->GetScalarMapPL()->GetSourceRange(aRange);
+ myScalarMap->GetPrsMergerPL()->GetSourceRange(aRange);
MinEdit->setText( QString::number( aRange[0] ) );
MaxEdit->setText( QString::number( aRange[1] ) );
myScalarMap->SetScalarMode(aMode);
connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
}
+/*!
+ Set values in the dialog from the presentation
+*/
+void VisuGUI_ScalarBarDlg::initFromPrsObject(VISU::PrsMerger_i* thePrs)
+{
+ myScalarPane->initFromPrsObject(thePrs);
+}
+
+/*!
+ Set values to presentation from the dialog
+*/
+int VisuGUI_ScalarBarDlg::storeToPrsObject(VISU::PrsMerger_i* thePrs)
+{
+ return myScalarPane->storeToPrsObject(thePrs);
+}
+
/*!
Called when <OK> button is clicked, validates data and closes dialog
*/
onHelp();
}
}
+
+
#include <qtoolbutton.h>
#include "QtxDblSpinBox.h"
+#include "QtxListBox.h"
-#include "VISU_ScalarMap_i.hh"
+#include "VISU_PrsMerger_i.hh"
class QButtonGroup;
class QGroupBox;
class QVBox;
class QToolButton;
-class QtxDblSpinBox;
+class QListBoxItem;
class SalomeApp_Module;
class SVTK_FontWidget;
class VISU_ScalarMapAct;
};
+class VisuGUI_ListBox: public QtxListBox
+{
+ Q_OBJECT;
+
+ public:
+ VisuGUI_ListBox( QWidget * parent = 0, const char * name = 0, WFlags f = 0 )
+ : QtxListBox(parent, name, f) {};
+ ~VisuGUI_ListBox() {};
+
+ virtual QSize sizeHint() const { return minimumSizeHint(); };
+};
+
+
class VisuGUI_ScalarBarPane : public QVBox
{
Q_OBJECT;
void initFromResources();
void storeToResources();
- void initFromPrsObject(VISU::ScalarMap_i* thePrs);
- int storeToPrsObject(VISU::ScalarMap_i* thePrs);
+ void initFromPrsObject(VISU::PrsMerger_i* thePrs);
+ int storeToPrsObject(VISU::PrsMerger_i* thePrs);
bool check();
void deletePreview();
+ bool eventFilter (QObject* object, QEvent* event);
+
protected:
+ QGroupBox* myMainGroupBox;
+ QCheckBox* myOnGroupsCB;
+ VisuGUI_ListBox* myAllGroups;
+ VisuGUI_ListBox* mySelectedGroups;
+ QToolButton* myAddButton;
+ QToolButton* myRemoveButton;
+
QButtonGroup* RangeGroup;
QRadioButton* RBFrange;
QRadioButton* RBIrange;
bool myIsStoreTextProp;
private slots:
+ void onTypeChanged();
+ void onListDoubleClicked( QListBoxItem* theItem );
+ void onAdd();
+ void onRemove();
+
void changeDefaults( int );
void changeRange( int );
void XYChanged( double );
QCheckBox* myPreviewCheck;
VISU_ScalarMapAct* myPreviewActor;
- VISU::ScalarMap_i* myScalarMap;
- VISU_ScalarMapPL* myScalarMapPL;
+ VISU::PrsMerger_i* myScalarMap;
+ VISU_PrsMergerPL* myScalarMapPL;
std::string myTitle;
bool myBusy;
void initFromResources() {myScalarPane->initFromResources();}
void storeToResources() {myScalarPane->storeToResources();}
- void initFromPrsObject(VISU::ScalarMap_i* thePrs) {myScalarPane->initFromPrsObject(thePrs);}
- int storeToPrsObject(VISU::ScalarMap_i* thePrs) {return myScalarPane->storeToPrsObject(thePrs);}
+ void initFromPrsObject(VISU::PrsMerger_i* thePrs);
+ int storeToPrsObject(VISU::PrsMerger_i* thePrs);
private:
void keyPressEvent( QKeyEvent* e );
}
switch (aPrsType) {
- case VISU::TSCALARMAP: //Scalar Map
+ case VISU::TPRSMERGER: //Scalar Map
myTypeCombo->setCurrentItem(myTypeId2ComboId[TSCALARMAP_ITEM]);
break;
case VISU::TISOSURFACE: //Iso Surfaces
switch (aType) {
case TSCALARMAP_ITEM: //Scalar Map
- aData.myPrsType = VISU::TSCALARMAP;
+ aData.myPrsType = VISU::TPRSMERGER;
break;
case TISOSURFACE_ITEM: //Iso Surfaces
aData.myPrsType = VISU::TISOSURFACE;
switch (aType) {
case TSCALARMAP_ITEM: //Scalar Map
c.suspend();
- EditPrs<VISU::ScalarMap_i,VisuGUI_ScalarBarDlg>(myModule,aData,myAnimator);
+ EditPrs<VISU::PrsMerger_i,VisuGUI_ScalarBarDlg>(myModule,aData,myAnimator);
break;
case TISOSURFACE_ITEM: //Iso Surfaces
c.suspend();
}
}
+ SalomeApp_Module* aModule = (SalomeApp_Module*)theModule;
+ UpdateObjBrowser(aModule, false, aResultSObj);
+
theModule->application()->putInfo(QObject::tr("INF_DONE"));
// Make "Save" button active
theModule->getApp()->updateActions();
if (!CORBA::is_nil(aVisuObj)) {
VISU::VISUType aType = aVisuObj->GetType();
switch (aType) {
- case VISU::TSCALARMAP:
+ case VISU::TPRSMERGER:
case VISU::TISOSURFACE:
case VISU::TDEFORMEDSHAPE:
case VISU::TCUTPLANES:
VISU_TimeAnimation.cxx \
VISU_CorbaMedConvertor.cxx \
VISU_DumpPython.cc \
- VISU_ScalarMapOnDeformedShape_i.cc
+ VISU_ScalarMapOnDeformedShape_i.cc \
+ VISU_PrsMerger_i.cc
LIB_MOC = \
VISU_TimeAnimation.h
VISU_ViewManager_i.hh \
VISU_View_i.hh \
VISU_TimeAnimation.h \
- VISU_ScalarMapOnDeformedShape_i.hh
+ VISU_ScalarMapOnDeformedShape_i.hh \
+ VISU_PrsMerger_i.hh
# additionnal information to compil and link file
CPPFLAGS += \
}
//----------------------------------------------------------------------------
+
+
VISU::Storable*
VISU::ColoredPrs3d_i
::Build(int theRestoring)
CORBA::String_var anIOR = GetID();
CreateAttributes(myStudy,anEntry.c_str(),aRefFatherEntry.c_str(),anIOR,myName.c_str(),"",aComment.latin1(),true);
mySObject = myStudy->FindObjectIOR(anIOR);
+
+ // Set icon
+ if (GetIconName() != 0)
+ {
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributePixMap_var aPixmap;
+
+ anAttr = aStudyBuilder->FindOrCreateAttribute( mySObject, "AttributePixMap" );
+ aPixmap = SALOMEDS::AttributePixMap::_narrow( anAttr );
+ aPixmap ->SetPixMap(GetIconName());
+ }
}
#ifndef _DEXCEPT_
}catch(std::exception& exc){
virtual
void
DoHook();
+
+ virtual
+ const char*
+ GetIconName() = 0;
};
}
for(int i=0;i<aLen;i++){
int anId = aGeom2ProfileIds[i];
aGeom2Profile.push_back(anId);
- cout << "------------------------------->" << anId << endl;
+ if(MYDEBUG) cout << "------------------------------->" << anId << endl;
}
- cout << endl;
+ if(MYDEBUG) cout << endl;
} catch(...) {
continue;
}
int VISU::CutLines_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, int theIteration, int isMemoryCheck)
{
- return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
+ return TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
}
int VISU::CutLines_i::myNbPresent = 0;
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
+ TSuperClass(theResult,theAddToStudy),
myCutLinesPL(NULL),
myUseAbsLength(false)
{}
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
+ TSuperClass(theResult,theSObject),
myCutLinesPL(NULL),
myUseAbsLength(false)
{
void VISU::CutLines_i::ToStream(std::ostringstream& theStr){
- ScalarMap_i::ToStream(theStr);
+ TSuperClass::ToStream(theStr);
int aNbLines = GetNbLines();
if(!myPipeLine) myPipeLine = VISU_CutLinesPL::New();
myCutLinesPL = dynamic_cast<VISU_CutLinesPL*>(myPipeLine);
- ScalarMap_i::DoHook();
+ TSuperClass::DoHook();
+}
+
+const char*
+VISU::CutLines_i
+::GetIconName()
+{
+ if (!GetNumberOfGeom())
+ return "ICON_TREE_CUT_LINES";
+ else
+ return "ICON_TREE_CUT_LINES_GROUPS";
}
VISU_Actor*
VISU::CutLines_i
::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
- if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+ if(VISU_Actor* anActor = TSuperClass::CreateActor(theIO)){
anActor->SetVTKMapping(true);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU" , "cut_lines_represent", 2);
#ifndef VISU_CutLines_i_HeaderFile
#define VISU_CutLines_i_HeaderFile
-#include "VISU_ScalarMap_i.hh"
+#include "VISU_PrsMerger_i.hh"
class VISU_CutLinesPL;
namespace VISU{
class CutLines_i : public virtual POA_VISU::CutLines,
- public virtual ScalarMap_i
+ public virtual PrsMerger_i
{
static int myNbPresent;
CutLines_i();
CutLines_i(const CutLines_i&);
public:
- typedef ScalarMap_i TSuperClass;
+ typedef PrsMerger_i TSuperClass;
explicit
CutLines_i(Result_i* theResult,
protected:
virtual void DoHook();
+ virtual const char* GetIconName();
+
VISU_CutLinesPL *myCutLinesPL;
TCurvesInv myMapCurvesInverted;
CORBA::Boolean myUseAbsLength;
int VISU::CutPlanes_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, int theIteration, int isMemoryCheck)
{
- return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
+ return TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
}
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
+ TSuperClass(theResult,theAddToStudy),
myCutPlanesPL(NULL)
{}
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
+ TSuperClass(theResult,theSObject),
myCutPlanesPL(NULL)
{
}
VISU::Storable* VISU::CutPlanes_i::Create(const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, int theIteration)
{
- return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+ return TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
}
void VISU::CutPlanes_i::ToStream(std::ostringstream& theStr){
- ScalarMap_i::ToStream(theStr);
+ TSuperClass::ToStream(theStr);
Storable::DataToStream( theStr, "myNbPlanes", int(GetNbPlanes()));
Storable::DataToStream( theStr, "myDisplacement", GetDisplacement());
if(!myPipeLine) myPipeLine = VISU_CutPlanesPL::New();
myCutPlanesPL = dynamic_cast<VISU_CutPlanesPL*>(myPipeLine);
- ScalarMap_i::DoHook();
+ TSuperClass::DoHook();
+}
+
+const char*
+VISU::CutPlanes_i
+::GetIconName()
+{
+ if (!GetNumberOfGeom())
+ return "ICON_TREE_CUT_PLANES";
+ else
+ return "ICON_TREE_CUT_PLANES_GROUPS";
}
VISU_Actor*
VISU::CutPlanes_i
::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
- if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+ if(VISU_Actor* anActor = TSuperClass::CreateActor(theIO)){
anActor->SetVTKMapping(true);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU" , "cut_planes_represent", 1);
#ifndef VISU_CutPlanes_i_HeaderFile
#define VISU_CutPlanes_i_HeaderFile
-#include "VISU_ScalarMap_i.hh"
+#include "VISU_PrsMerger_i.hh"
class VISU_CutPlanesPL;
namespace VISU{
class CutPlanes_i : public virtual POA_VISU::CutPlanes,
- public virtual ScalarMap_i
+ public virtual PrsMerger_i
{
static int myNbPresent;
CutPlanes_i();
CutPlanes_i(const CutPlanes_i&);
public:
- typedef ScalarMap_i TSuperClass;
+ typedef PrsMerger_i TSuperClass;
explicit
CutPlanes_i(Result_i* theResult,
protected:
virtual void DoHook();
+ virtual const char* GetIconName();
+
VISU_CutPlanesPL *myCutPlanesPL;
public:
const char* theFieldName, int theIteration, int isMemoryCheck)
{
try{
- if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck)) return 0;
+ if(!TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck)) return 0;
const VISU::PField aField = theResult->GetInput()->GetField(theMeshName,(VISU::TEntity)theEntity,theFieldName);
return aField->myNbComp > 1;
}catch(std::exception& exc){
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
+ TSuperClass(theResult,theAddToStudy),
myDeformedShapePL(NULL)
{
if(MYDEBUG) MESSAGE("DeformedShape_i::DeformedShape_i");
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
+ TSuperClass(theResult,theSObject),
myDeformedShapePL(NULL)
{
if(MYDEBUG) MESSAGE("DeformedShape_i::DeformedShape_i");
{
myIsColored = false;
myColor.R = myColor.G = myColor.B = 0.5;
- return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+ return TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
}
void VISU::DeformedShape_i::ToStream(std::ostringstream& theStr){
- ScalarMap_i::ToStream(theStr);
+ TSuperClass::ToStream(theStr);
Storable::DataToStream( theStr, "myFactor", GetScale() );
myDeformedShapePL = dynamic_cast<VISU_DeformedShapePL*>(myPipeLine);
myPipeLine->GetMapper()->SetScalarVisibility(IsColored());
- ScalarMap_i::DoHook();
+ TSuperClass::DoHook();
}
+const char*
+VISU::DeformedShape_i
+::GetIconName()
+{
+ if (!GetNumberOfGeom())
+ return "ICON_TREE_DEFORMED_SHAPE";
+ else
+ return "ICON_TREE_DEFORMED_SHAPE_GROUPS";
+}
+
+
void VISU::DeformedShape_i::SetMapScale(double theMapScale){
myDeformedShapePL->SetMapScale(theMapScale);
}
VISU::DeformedShape_i
::CreateActor(const Handle(SALOME_InteractiveObject)& theIO, bool toSupressShrinking)
{
- VISU_Actor* anActor = VISU::ScalarMap_i::CreateActor(theIO, true);
+ VISU_Actor* anActor = TSuperClass::CreateActor(theIO, true);
anActor->SetVTKMapping(false);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU", "deformed_shape_represent", 1);
myPipeLine->GetMapper()->SetScalarVisibility(0);
anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
}
- VISU::ScalarMap_i::UpdateActor(theActor);
+ TSuperClass::UpdateActor(theActor);
}
}
#ifndef VISU_DeformedShape_i_HeaderFile
#define VISU_DeformedShape_i_HeaderFile
-#include "VISU_ScalarMap_i.hh"
+#include "VISU_PrsMerger_i.hh"
class VISU_DeformedShapePL;
namespace VISU{
class DeformedShape_i : public virtual POA_VISU::DeformedShape,
- public virtual ScalarMap_i
+ public virtual PrsMerger_i
{
static int myNbPresent;
DeformedShape_i();
DeformedShape_i(const DeformedShape_i&);
public:
- typedef ScalarMap_i TSuperClass;
+ typedef PrsMerger_i TSuperClass;
explicit
DeformedShape_i(Result_i* theResult,
protected:
virtual void DoHook();
+
+ virtual const char* GetIconName();
VISU_DeformedShapePL *myDeformedShapePL;
SALOMEDS::Color myColor;
#include "VISU_Prs3d_i.hh"
#include "VISU_Mesh_i.hh"
+#include "VISU_PrsMerger_i.hh"
#include "VISU_ScalarMap_i.hh"
#include "VISU_IsoSurfaces_i.hh"
#include "VISU_DeformedShape_i.hh"
return thePrefix;
}
-
+ //===========================================================================
+ std::string
+ PrsMergerToPython(SALOMEDS::SObject_ptr theSObject,
+ VISU::PrsMerger_i* theServant,
+ std::ostream& theStr,
+ std::string& theName,
+ const std::string& theConstructorName,
+ const std::string& theArgumentName,
+ std::string thePrefix)
+ {
+ thePrefix = ScalarMapToPython(theSObject,theServant,theStr,theName,theConstructorName,theArgumentName,thePrefix);
+ string_array_var aGroupNames = theServant->getGroupNames();
+ for(int i=0; i<aGroupNames->length(); i++)
+ {
+ theStr<<thePrefix<<theName<<".AddMeshOnGroup('"
+ <<theServant->GetMeshName()<<"','"
+ <<aGroupNames[i]<<"')"<<endl;
+ }
+ return thePrefix;
+ }
+
//===========================================================================
std::string
DeformedShapeToPython(SALOMEDS::SObject_ptr theSObject,
return;
}
break;
+ case VISU::TPRSMERGER:
+ if(PrsMerger_i* aServant = dynamic_cast<PrsMerger_i*>(GetServant(anObj).in())){
+ thePrefix = PrsMergerToPython(theSObject,aServant,theStr,aName,"ScalarMapOnField",theArgumentName,thePrefix);
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
case VISU::TSCALARMAP:
if(ScalarMap_i* aServant = dynamic_cast<ScalarMap_i*>(GetServant(anObj).in())){
thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"ScalarMapOnField",theArgumentName,thePrefix);
void
DoHook();
+ virtual
+ const char*
+ GetIconName() {return "ICON_TREE_GAUSS_POINTS";}
+
virtual
VISU_PipeLine*
GetPipeLine();
#include "VISU_Table_i.hh"
#include "VISU_TimeAnimation.h"
#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_PrsMerger_i.hh"
#include "VISU_Actor.h"
void RegistryStorable() {
Storable::Registry(Result_i::myComment.c_str(),&(Result_i::Restore));
Storable::Registry(Mesh_i::myComment.c_str(),&(Restore<Mesh_i>));
- Storable::Registry(ScalarMap_i::myComment.c_str(),&(Restore<ScalarMap_i>));
+ // Storable::Registry(ScalarMap_i::myComment.c_str(),&(Restore<ScalarMap_i>));
Storable::Registry(GaussPoints_i::myComment.c_str(),&(Restore<GaussPoints_i>));
Storable::Registry(DeformedShape_i::myComment.c_str(),&(Restore<DeformedShape_i>));
Storable::Registry(CutPlanes_i::myComment.c_str(),&(Restore<CutPlanes_i>));
Storable::Registry(Curve_i::myComment.c_str(),&(Curve_i::Restore));
Storable::Registry(Container_i::myComment.c_str(),&(Container_i::Restore));
Storable::Registry(ScalarMapOnDeformedShape_i::myComment.c_str(),&(Restore<ScalarMapOnDeformedShape_i>));
+ Storable::Registry(PrsMerger_i::myComment.c_str(),&(Restore<PrsMerger_i>));
}
else if ( !aComment.compare(QString("CONTAINER")) ) aVISUType = VISU::TCONTAINER;
else if ( !aComment.compare(QString("MESH")) ) aVISUType = VISU::TMESH;
else if ( !aComment.compare(QString("SCALARMAP")) ) aVISUType = VISU::TSCALARMAP;
+ else if ( !aComment.compare(QString("PRSMERGER")) ) aVISUType = VISU::TPRSMERGER;
else if ( !aComment.compare(QString("ISOSURFACE")) ) aVISUType = VISU::TISOSURFACE;
else if ( !aComment.compare(QString("DEFORMEDSHAPE")) ) aVISUType = VISU::TDEFORMEDSHAPE;
else if ( !aComment.compare(QString("SCALARMAPONDEFORMEDSHAPE")) ) aVISUType = VISU::TSCALARMAPONDEFORMEDSHAPE;
const char* theFieldName,
CORBA::Double theIteration)
{
- return Prs3dOnField<VISU::ScalarMap_i>(theResult,theMeshName,theEntity,theFieldName,theIteration,true)._retn();
+ //return Prs3dOnField<VISU::ScalarMap_i>(theResult,theMeshName,theEntity,theFieldName,theIteration,true)._retn();
+ return Prs3dOnField<VISU::PrsMerger_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
}
GaussPoints_ptr VISU_Gen_i::GaussPointsOnField(Result_ptr theResult,
int VISU::IsoSurfaces_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, int theIteration, int isMemoryCheck)
{
- return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
+ return TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
}
int VISU::IsoSurfaces_i::myNbPresent = 0;
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
+ TSuperClass(theResult,theAddToStudy),
myIsoSurfacesPL(NULL)
{}
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
+ TSuperClass(theResult,theSObject),
myIsoSurfacesPL(NULL)
{
}
VISU::Storable* VISU::IsoSurfaces_i::Create(const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, int theIteration)
{
- return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+ return TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
}
}
void VISU::IsoSurfaces_i::ToStream(std::ostringstream& theStr){
- ScalarMap_i::ToStream(theStr);
+ TSuperClass::ToStream(theStr);
Storable::DataToStream( theStr, "myNbSurface", int(GetNbSurfaces()) );
Storable::DataToStream( theStr, "myRange[0]", GetSubMin() );
if(!myPipeLine) myPipeLine = VISU_IsoSurfacesPL::New();
myIsoSurfacesPL = dynamic_cast<VISU_IsoSurfacesPL*>(myPipeLine);
- ScalarMap_i::DoHook();
+ TSuperClass::DoHook();
}
+const char*
+VISU::IsoSurfaces_i
+::GetIconName()
+{
+ if (!GetNumberOfGeom())
+ return "ICON_TREE_ISO_SURFACES";
+ else
+ return "ICON_TREE_ISO_SURFACES_GROUPS";
+}
VISU_Actor*
VISU::IsoSurfaces_i
::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
- if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+ if(VISU_Actor* anActor = TSuperClass::CreateActor(theIO)){
anActor->SetVTKMapping(true);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU" , "iso_surfaces_represent", 2);
#ifndef VISU_IsoSurfaces_i_HeaderFile
#define VISU_IsoSurfaces_i_HeaderFile
-#include "VISU_ScalarMap_i.hh"
+#include "VISU_PrsMerger_i.hh"
class VISU_IsoSurfacesPL;
namespace VISU{
class IsoSurfaces_i : public virtual POA_VISU::IsoSurfaces,
- public virtual ScalarMap_i
+ public virtual PrsMerger_i
{
static int myNbPresent;
IsoSurfaces_i();
IsoSurfaces_i(const IsoSurfaces_i&);
public:
- typedef ScalarMap_i TSuperClass;
+ typedef PrsMerger_i TSuperClass;
explicit
IsoSurfaces_i(Result_i* theResult,
protected:
virtual void DoHook();
+ virtual const char* GetIconName();
+
VISU_IsoSurfacesPL* myIsoSurfacesPL;
public:
}
};
+ // Unset icon
+ SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+ aStudyBuilder->RemoveAttribute(GetSObject(), "AttributePixMap");
+
ProcessVoidEvent(new TRemoveFromStudy(this));
}
CORBA::String_var aString = GetID();
anIOR->SetValue(aString);
}
+
+ // Set icon
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributePixMap_var aPixmap;
+
+ anAttr = aStudyBuilder->FindOrCreateAttribute( mySObject, "AttributePixMap" );
+ aPixmap = SALOMEDS::AttributePixMap::_narrow( anAttr );
+ aPixmap->SetPixMap("ICON_TREE_MESH");
+
}catch(std::exception& exc){
INFOS("Follow exception was occured :\n"<<exc.what());
return NULL;
int VISU::Plot3D_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, int theIteration, int isMemoryCheck)
{
- return VISU::ScalarMap_i::IsPossible
+ return TSuperClass::IsPossible
(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
}
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
+ TSuperClass(theResult,theAddToStudy),
myPlot3DPL(NULL)
{}
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
+ TSuperClass(theResult,theSObject),
myPlot3DPL(NULL)
{}
VISU::Storable* VISU::Plot3D_i::Create (const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, int theIteration)
{
- return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+ return TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
}
VISU::Storable* VISU::Plot3D_i::Restore (const Storable::TRestoringMap& theMap)
void VISU::Plot3D_i::ToStream (std::ostringstream& theStr)
{
- ScalarMap_i::ToStream(theStr);
+ TSuperClass::ToStream(theStr);
Storable::DataToStream(theStr, "myBasePlane", int(GetOrientationType()));
Storable::DataToStream(theStr, "aRot[0]", GetRotateX());
if (!myPipeLine) myPipeLine = VISU_Plot3DPL::New();
myPlot3DPL = dynamic_cast<VISU_Plot3DPL*>(myPipeLine);
- ScalarMap_i::DoHook();
+ TSuperClass::DoHook();
+}
+
+const char*
+VISU::Plot3D_i
+::GetIconName()
+{
+ if (!GetNumberOfGeom())
+ return "ICON_TREE_PLOT_3D";
+ else
+ return "ICON_TREE_PLOT_3D_GROUPS";
}
VISU_Actor*
VISU::Plot3D_i
::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
- if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+ if(VISU_Actor* anActor = TSuperClass::CreateActor(theIO)){
anActor->SetVTKMapping(true);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU", "plot3d_represent", 2);
#ifndef VISU_Plot3D_i_HeaderFile
#define VISU_Plot3D_i_HeaderFile
-#include "VISU_ScalarMap_i.hh"
+#include "VISU_PrsMerger_i.hh"
class VISU_Plot3DPL;
namespace VISU {
class Plot3D_i : public virtual POA_VISU::Plot3D,
- public virtual ScalarMap_i
+ public virtual PrsMerger_i
{
static int myNbPresent;
Plot3D_i();
Plot3D_i(const Plot3D_i&);
public:
- typedef ScalarMap_i TSuperClass;
+ typedef PrsMerger_i TSuperClass;
explicit
Plot3D_i (Result_i* theResult, bool theAddToStudy = true);
protected:
virtual void DoHook();
+ virtual const char* GetIconName();
+
VISU_Plot3DPL *myPlot3DPL;
public:
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File : VISU_PrsMerger_i.cc
+// Author : Eugeny Nikolaev
+// Module : VISU
+
+#include "VISU_PrsMerger_i.hh"
+#include "VISU_PrsMergerPL.hxx"
+#include "VISU_MeshPL.hxx"
+#include "VISU_ScalarMapPL.hxx"
+#include "VISU_Convertor.hxx"
+
+#include "VISU_Result_i.hh"
+#include "VISU_ScalarMapAct.h"
+#include "VISU_ScalarMap_i.hh"
+#include "SUIT_ResourceMgr.h"
+
+#include "SUIT_Session.h"
+#include "SALOME_Event.hxx"
+#include "SalomeApp_Study.h"
+#include "SalomeApp_Application.h"
+
+#include <vtkUnstructuredGrid.h>
+#include <vtkCellType.h>
+#include <vtkProperty.h>
+#include <vtkMapper.h>
+
+using namespace VISU;
+using namespace std;
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+static int INCMEMORY = 4;
+
+int VISU::PrsMerger_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
+ const char* theFieldName, int theIteration, int isMemoryCheck)
+{
+ try{
+ float aSize = INCMEMORY*
+ theResult->GetInput()->GetTimeStampSize(theMeshName,(VISU::TEntity)theEntity,theFieldName,theIteration);
+ bool aResult = true;
+ if(isMemoryCheck){
+ aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+ MESSAGE("PrsMerger_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+ }
+ return aResult;
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ }
+ return 0;
+}
+
+int VISU::PrsMerger_i::myNbPresent = 0;
+QString VISU::PrsMerger_i::GenerateName() { return VISU::GenerateName("ScalarMap",myNbPresent++);}
+
+const string VISU::PrsMerger_i::myComment = "PRSMERGER";
+const char* VISU::PrsMerger_i::GetComment() const { return myComment.c_str();}
+
+VISU::PrsMerger_i::
+PrsMerger_i(Result_i* theResult,
+ bool theAddToStudy) :
+ PrsObject_i(theResult->GetStudyDocument()),
+ Prs3d_i(theResult,theAddToStudy),
+ ColoredPrs3d_i(theResult,theAddToStudy),
+ ScalarMap_i(theResult,theAddToStudy),
+ myPrsMergerPL(NULL),
+ myScalarsPL(VISU_ScalarMapPL::New())
+{
+}
+
+VISU::PrsMerger_i::
+PrsMerger_i(Result_i* theResult,
+ SALOMEDS::SObject_ptr theSObject):
+ PrsObject_i(theResult->GetStudyDocument()),
+ Prs3d_i(theResult,theSObject),
+ ColoredPrs3d_i(theResult,theSObject),
+ ScalarMap_i(theResult,theSObject),
+ myPrsMergerPL(NULL),
+ myScalarsPL(VISU_ScalarMapPL::New())
+{
+}
+
+VISU::Storable* VISU::PrsMerger_i::Create(const char* theMeshName, VISU::Entity theEntity,
+ const char* theFieldName, int theIteration)
+{
+ if (MYDEBUG) MESSAGE("PrsMerger_i::Create");
+ myIsColored = true;
+ myColor.R = myColor.G = myColor.B = 0.5;
+ VISU::Storable* aRes = TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
+ this->SetScalarMap(theMeshName,theEntity,theFieldName,theIteration);
+
+ return aRes;
+}
+
+VISU::Storable* VISU::PrsMerger_i::Restore(const Storable::TRestoringMap& theMap)
+{
+ if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::Restore");
+
+ TSuperClass::Restore(theMap);
+
+ SetScalarMap(myMeshName.c_str(),
+ VISU::Entity(myEntity),
+ myFieldName.c_str(),
+ myIteration);
+ // myMeshName = VISU::Storable::FindValue(theMap,"myMeshName").latin1();
+ QStringList aStrSubMeshName = QStringList::split("|",VISU::Storable::FindValue(theMap,"myGeomNameList") );
+ QStringList aStrEntity = QStringList::split("|",VISU::Storable::FindValue(theMap,"myGeomEntityList") );
+ int aC1 = aStrSubMeshName.count();
+ int aC2 = aStrEntity.count();
+ if(aC1 != aC2){
+ // warning situation
+ return this;
+ }
+ for(int i=0;i < aC2;i++){
+ std::string aSubMeshName = aStrSubMeshName[i];
+ int aEntity = aStrEntity[i].toInt();
+ if(aEntity == -1){
+ // add group
+ AddMeshOnGroup(myMeshName.c_str(),
+ aSubMeshName.c_str());
+ } else if (aEntity >= 0){
+ // entity and family
+ if(aSubMeshName == ""){
+ // entity
+ SetMeshOnEntity(myMeshName.c_str(),
+ VISU::Entity(aEntity));
+ } else {
+ // family
+ SetFamilyOnEntity(myMeshName.c_str(),
+ VISU::Entity(aEntity),
+ aSubMeshName.c_str());
+ }
+
+ }
+ }
+
+ return this;
+}
+
+void VISU::PrsMerger_i::ToStream(std::ostringstream& theStr)
+{
+ if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::ToStream:");
+ TSuperClass::ToStream(theStr);
+
+ QString aStrSubMeshName,aStrEntity;
+ TNameAndEntityList::iterator aIter = myGeomNameEntityList.begin();
+ for(;aIter!=myGeomNameEntityList.end();aIter++){
+ std::string aStr = aIter->first + "|";
+ aStrSubMeshName.append(aStr.c_str());
+ aStrEntity.append(QString::number(aIter->second) + "|");
+ }
+
+ Storable::DataToStream( theStr, "myMeshName", myMeshName.c_str() );
+ Storable::DataToStream( theStr, "myGeomNameList", aStrSubMeshName.latin1());
+ Storable::DataToStream( theStr, "myGeomEntityList", aStrEntity.latin1());
+
+}
+
+void VISU::PrsMerger_i::clearMeshList()
+{
+ VISU_PrsMergerPL::TPipeLines::const_iterator aIter = myMeshPLList.begin();
+ for(int i=0;aIter != myMeshPLList.end();aIter++,i++){
+ ((*aIter).GetPointer())->Delete();
+ }
+ myMeshPLList.clear();
+ myGeomNameEntityList.clear();
+}
+
+void VISU::PrsMerger_i::RemoveAllGeom()
+{
+ clearMeshList();
+ myPrsMergerPL->RemoveAllGeom();
+
+ UpdateIcon();
+}
+
+
+VISU::PrsMerger_i::~PrsMerger_i(){
+ if(MYDEBUG) if (MYDEBUG) MESSAGE("PrsMerger_i::~PrsMerger_i()");
+ this->clearMeshList();
+}
+
+void
+VISU::PrsMerger_i
+::SameAs(const Prs3d_i* theOrigin)
+{
+ if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::SameAs:");
+
+ TSuperClass::SameAs(theOrigin);
+
+ if(const PrsMerger_i* aPrs3d = dynamic_cast<const PrsMerger_i*>(theOrigin)){
+ PrsMerger_i* anOrigin = const_cast<PrsMerger_i*>(aPrs3d);
+ this->SetScalarMap(myMeshName.c_str(),VISU::Entity(myEntity),myFieldName.c_str(),myIteration);
+ string_array_var aGroupNames = anOrigin->getGroupNames();
+ for(int i=0;i<aGroupNames->length();i++){
+ this->AddMeshOnGroup(myMeshName.c_str(),aGroupNames[i]);
+ }
+ Update();
+ }
+}
+
+VISU_Actor*
+VISU::PrsMerger_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO, bool toSupressShrinking)
+{
+ if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::CreateActor:");
+ return VISU::ScalarMap_i::CreateActor(theIO, true);
+}
+
+VISU_Actor* VISU::PrsMerger_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+{
+ return CreateActor(theIO, false);
+}
+
+void VISU::PrsMerger_i::UpdateActor(VISU_Actor* theActor) {
+ if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::UpdateActor");
+ TSuperClass::UpdateActor(theActor);
+}
+
+void
+VISU::PrsMerger_i::
+SetMeshOnGroup(const char* theMeshName,
+ const char* theGroupName)
+{
+ if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::SetMeshOnGroup:");
+ VISU::PIDMapper anIDMapper;
+ anIDMapper = myResult->GetInput()->GetMeshOnGroup(theMeshName,theGroupName);
+
+ VISU_MeshPL* aTmpMesh = VISU_MeshPL::New();
+ aTmpMesh->SetIDMapper(anIDMapper);
+
+ if(myPrsMergerPL->SetGeometry(aTmpMesh)){
+ this->clearMeshList();
+ myMeshPLList.push_back(aTmpMesh);
+ TPairStringAndInt aPair((std::string)theGroupName,-1);
+ myGeomNameEntityList.push_back(aPair);
+ }
+ else
+ aTmpMesh->Delete();
+
+ UpdateIcon();
+}
+
+CORBA::Long
+VISU::PrsMerger_i::
+AddMeshOnGroup(const char* theMeshName,
+ const char* theGroupName)
+{
+ if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::AddMeshOnGroup |"<< theGroupName <<"|");
+ CORBA::Long aRetVal = -1;
+ VISU::PIDMapper anIDMapper;
+ anIDMapper = myResult->GetInput()->GetMeshOnGroup(theMeshName,theGroupName);
+ if(!anIDMapper)
+ MESSAGE("Warning: There are no mesh with group=|"<<theGroupName<<"|");
+ VISU_MeshPL* aTmpMesh = VISU_MeshPL::New();
+ aTmpMesh->SetIDMapper(anIDMapper);
+
+ aRetVal = myPrsMergerPL->AddBackGeometry(aTmpMesh);
+
+ if(aRetVal >-1 ){
+ myMeshPLList.push_back(aTmpMesh);
+ TPairStringAndInt aPair((std::string)theGroupName,-1);
+ myGeomNameEntityList.push_back(aPair);
+ }
+ else
+ aTmpMesh->Delete();
+
+ if (MYDEBUG) MESSAGE("AddMeshOnGroup nbGeoms after ="<<myPrsMergerPL->GetNbGeometry());
+
+ UpdateIcon();
+
+ return aRetVal;
+}
+
+void
+VISU::PrsMerger_i::
+SetFamilyOnEntity(const char* theMeshName,
+ const VISU::Entity theEntity,
+ const char* theFamilyName)
+{
+ VISU::PIDMapper anIDMapper;
+ anIDMapper = myResult->GetInput()->GetFamilyOnEntity(theMeshName,(VISU::TEntity)theEntity,theFamilyName);
+
+
+ VISU_MeshPL* aTmpMesh = VISU_MeshPL::New();
+ aTmpMesh->SetIDMapper(anIDMapper);
+
+ if(myPrsMergerPL->SetGeometry(aTmpMesh)){
+ myMeshPLList.push_back(aTmpMesh);
+ TPairStringAndInt aPair((std::string)theFamilyName,(int)theEntity);
+ myGeomNameEntityList.push_back(aPair);
+ }
+ else
+ aTmpMesh->Delete();
+}
+
+void
+VISU::PrsMerger_i::
+SetMeshOnEntity(const char* theMeshName,
+ const VISU::Entity theEntity)
+{
+ VISU::PIDMapper anIDMapper;
+ anIDMapper = myResult->GetInput()->GetMeshOnEntity(theMeshName,(VISU::TEntity)theEntity);
+ VISU_MeshPL* aTmpMesh = VISU_MeshPL::New();
+ aTmpMesh->SetIDMapper(anIDMapper);
+
+ if(myPrsMergerPL->SetGeometry(aTmpMesh)){
+ myMeshPLList.push_back(aTmpMesh);
+ TPairStringAndInt aPair("",(int)theEntity);
+ myGeomNameEntityList.push_back(aPair);
+ }
+ else
+ aTmpMesh->Delete();
+}
+
+void
+VISU::PrsMerger_i::
+SetScalarMap(const char* theMeshName,
+ const VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theStampsNum)
+{
+ if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::SetScalarMap");
+ VISU::PIDMapper anIDMapper;
+ anIDMapper = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,(VISU::TEntity)theEntity,theFieldName,int(theStampsNum));
+
+ myEntity = (VISU::TEntity)theEntity;
+ myFieldName = theFieldName;
+ myIteration = theStampsNum;
+
+ myScalarsPL->SetIDMapper(anIDMapper);
+ myPrsMergerPL->SetScalars(myScalarsPL);
+}
+
+void
+VISU::PrsMerger_i::
+SetScalarMap(VISU_PipeLine* thePipeLine)
+{
+ if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::SetScalarMap");
+ VISU_ScalarMapPL* aInputScalars = dynamic_cast<VISU_ScalarMapPL*>(thePipeLine);
+ VISU::PIDMapper anIDMapper = aInputScalars->GetIDMapper();
+ myScalarsPL->SetIDMapper(anIDMapper);
+ if(aInputScalars)
+ myPrsMergerPL->SetScalars(myScalarsPL);
+}
+
+void
+VISU::PrsMerger_i::
+RemoveGeometryByName(const char* theName)
+{
+ // not implemented yet.
+}
+
+void
+VISU::PrsMerger_i::
+RemoveGeometryById(CORBA::Long theId)
+{
+ if(myGeomNameEntityList.size() != myMeshPLList.size()){
+ // warning situation. Some information lost
+ // check myGeomNameEntityList and myMeshPLList
+ }
+
+ if(theId >=0 && (int)theId < myMeshPLList.size()){
+ VISU_PrsMergerPL::TPipeLines::iterator aIter = myMeshPLList.begin();
+ for(;aIter != myMeshPLList.end();aIter++){
+ if( myMeshPLList[theId] == (*aIter)){
+ myMeshPLList.erase(aIter);
+ break;
+ }
+ }
+ }
+ if(theId >=0 && (int)theId < myGeomNameEntityList.size()){
+ TNameAndEntityList::iterator aIter = myGeomNameEntityList.begin();
+ for(;aIter != myGeomNameEntityList.end();aIter++){
+ if( myGeomNameEntityList[theId] == (*aIter) ){
+ myGeomNameEntityList.erase(aIter);
+ break;
+ }
+ }
+ }
+ myPrsMergerPL->RemoveGeometryById((int)theId);
+}
+
+void
+VISU::PrsMerger_i
+::DoHook(){
+ if(!myPipeLine) myPipeLine = VISU_PrsMergerPL::New();
+ myPrsMergerPL = dynamic_cast<VISU_PrsMergerPL*>(myPipeLine);
+ myPipeLine->GetMapper()->SetScalarVisibility(IsColored());
+ TSuperClass::DoHook();
+}
+
+const char*
+VISU::PrsMerger_i
+::GetIconName()
+{
+ if (!GetNumberOfGeom())
+ return "ICON_TREE_SCALAR_MAP";
+ else
+ return "ICON_TREE_SCALAR_MAP_GROUPS";
+}
+
+void VISU::PrsMerger_i
+::UpdateIcon()
+{
+ if (mySObject->_is_nil())
+ return;
+
+ SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+
+ // Check if the icon needs to be updated, update if necessary
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributePixMap_var aPixmap;
+
+ anAttr = aStudyBuilder->FindOrCreateAttribute( mySObject, "AttributePixMap" );
+ aPixmap = SALOMEDS::AttributePixMap::_narrow( anAttr );
+
+ if ( aPixmap->GetPixMap() != (std::string)GetIconName() )
+ aPixmap->SetPixMap(GetIconName());
+
+ // Update Object Browser
+ SUIT_Session* aSession = SUIT_Session::session();
+ QPtrList<SUIT_Application> anApplications = aSession->applications();
+ QPtrListIterator<SUIT_Application> anIter (anApplications);
+ while (SUIT_Application* aSApp = anIter.current()) {
+ SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(aSApp);
+ if (!anApp) return;
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy());
+ if (!aStudy) return;
+ if (_PTR(Study) aCStudy = aStudy->studyDS()) {
+ if (myStudy->StudyId() == aCStudy->StudyId()) {
+ anApp->updateObjectBrowser();
+ break;
+ }
+ }
+ ++anIter;
+ }
+}
+
+CORBA::Long
+VISU::PrsMerger_i
+::GetNumberOfGeom()
+{
+ if(myPrsMergerPL)
+ return myPrsMergerPL->GetNbGeometry();
+ else
+ return 0;
+}
+
+string_array*
+VISU::PrsMerger_i
+::getGroupNames()
+{
+ string_array_var myseq = new string_array;
+ if(myPrsMergerPL){
+ vector<string> aGroupNames;
+ TNameAndEntityList::const_iterator aIter = myGeomNameEntityList.begin();
+ for(;aIter!=myGeomNameEntityList.end();aIter++){
+ TPairStringAndInt aPair = (*aIter);
+ if(aPair.second == -1)
+ aGroupNames.push_back(aPair.first);
+ }
+ myseq->length(aGroupNames.size());
+ vector<string>::const_iterator aNamesIter = aGroupNames.begin();
+ for(int i=0;aNamesIter!=aGroupNames.end();i++,aNamesIter++){
+ myseq[i] = CORBA::string_dup((*aNamesIter).c_str());
+ }
+ }
+ return myseq._retn();
+}
+
+bool
+VISU::PrsMerger_i
+::CheckGroup(const char* theGroupName)
+{
+ if (MYDEBUG) MESSAGE("PrsMerger_i::CheckGroup :|"<<theGroupName<<"|");
+ string aMeshName = myMeshName;
+ string aGroupName = theGroupName;
+
+ VISU::PIDMapper anIDMapper;
+ anIDMapper = myResult->GetInput()->GetMeshOnGroup(aMeshName,theGroupName);
+ if (MYDEBUG) MESSAGE("anIDMapper="<<anIDMapper);
+ if(!anIDMapper) return false;
+
+ bool aAllPoints = true;
+ if(anIDMapper->GetVTKOutput()->GetNumberOfCells()>0){
+ int aVtkCellType = anIDMapper->GetVTKOutput()->GetCellType(0);
+ if (MYDEBUG) MESSAGE("CellType="<<aVtkCellType);
+ switch(myEntity){
+ case NODE_ENTITY:
+ case CELL_ENTITY:
+ if(aVtkCellType != VTK_LINE &&
+ aVtkCellType != VTK_POLY_LINE &&
+ aVtkCellType != VTK_VERTEX &&
+ aVtkCellType != VTK_PIXEL)
+ aAllPoints = false;
+ break;
+ case EDGE_ENTITY:
+ if(aVtkCellType == VTK_LINE ||
+ aVtkCellType == VTK_POLY_LINE)
+ aAllPoints = false;
+ break;
+ case FACE_ENTITY:
+ if(aVtkCellType == VTK_TRIANGLE ||
+ aVtkCellType == VTK_TRIANGLE_STRIP ||
+ aVtkCellType == VTK_POLYGON ||
+ aVtkCellType == VTK_QUAD)
+ aAllPoints = false;
+ break;
+ }
+ }
+
+ if (MYDEBUG) MESSAGE("return="<<!aAllPoints);
+ return (!aAllPoints);
+}
+
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File : VISU_PrsMerger_i.hh
+// Author : Eugeny Nikolaev
+// Module : VISU
+
+#ifndef VISU_PrsMerger_i_HeaderFile
+#define VISU_PrsMerger_i_HeaderFile
+#include "VISU_ScalarMap_i.hh"
+#include "VISU_PrsMergerPL.hxx"
+
+#include "VISUConfig.hh"
+
+class VISU_MeshPL;
+
+namespace VISU{
+
+ class PrsMerger_i : public virtual POA_VISU::ScalarMap,
+ public virtual ScalarMap_i
+ {
+
+ /*!
+ * eON_GROUP - mesh created on group
+ * eFAMILY_ON_ENTITY - mesh created on family on entity
+ * eON_ENTITY - mesh created on entity (default value)
+ */
+ enum EMeshGeomPlace {eON_GROUP=1,eFAMILY_ON_ENTITY=2,eON_ENTITY=3};
+
+ static int myNbPresent;
+ PrsMerger_i();
+ PrsMerger_i(const PrsMerger_i&);
+
+ public:
+
+ typedef ScalarMap_i TSuperClass;
+ typedef std::pair<std::string,int> TPairStringAndInt;
+ typedef std::vector<TPairStringAndInt> TNameAndEntityList;
+
+ explicit
+ PrsMerger_i(Result_i* theResult,
+ bool theAddToStudy);
+ explicit
+ PrsMerger_i(Result_i* theResult,
+ SALOMEDS::SObject_ptr theSObject);
+ virtual void SameAs(const Prs3d_i* theOrigin);
+ virtual ~PrsMerger_i();
+
+ virtual VISU::VISUType GetType() { return VISU::TPRSMERGER;};
+
+ virtual CORBA::Boolean IsColored() { return myIsColored; }
+ virtual void ShowColored(CORBA::Boolean theColored) { myIsColored = theColored; }
+
+ virtual SALOMEDS::Color GetColor() { return myColor;}
+ virtual void SetColor(const SALOMEDS::Color& theColor) { myColor = theColor;}
+
+ VISU_PrsMergerPL* GetPrsMergerPL(){ return myPrsMergerPL;}
+
+ protected:
+ virtual void DoHook();
+ virtual const char* GetIconName();
+ void UpdateIcon();
+ void clearMeshList();
+
+ VISU_PrsMergerPL* myPrsMergerPL;
+ VISU_PrsMergerPL::TPipeLines myMeshPLList;
+ VISU_ScalarMapPL* myScalarsPL;
+
+ SALOMEDS::Color myColor;
+ bool myIsColored;
+
+ /*! Warning! This variable must be maked as list, if
+ * you we will need in different mesh entities (ENTITY,FAMILY,GROUP) as geometries.
+ */
+ TNameAndEntityList myGeomNameEntityList;
+
+ public:
+ static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
+ const char* theFieldName, int theIteration, int isMemoryCheck = true);
+
+ virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
+ const char* theFieldName, int theIteration);
+
+ virtual void ToStream(std::ostringstream& theStr);
+
+ virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+
+ static const std::string myComment;
+ virtual const char* GetComment() const;
+ virtual QString GenerateName();
+
+ virtual
+ VISU_Actor*
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
+ virtual
+ VISU_Actor*
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO, bool toSupressShrinking);
+
+ virtual void UpdateActor(VISU_Actor* theActor) ;
+
+ /*!
+ * Sets geometry of mesh as group
+ */
+ virtual void SetMeshOnGroup(const char* theMeshName,
+ const char* theGroupName);
+
+ /*!
+ * Add geometry of mesh as group
+ * \retval the id of added group.
+ */
+ virtual CORBA::Long AddMeshOnGroup(const char* theMeshName,
+ const char* theGroupName);
+
+ /*!
+ * Remove geometry from list by Name
+ */
+ virtual void RemoveGeometryByName(const char* theName);
+
+ /*!
+ * Removes geometry from list by id
+ * Note: theId number in [0,...]
+ *
+ * Waring: if you delete not 0 element, others indexes will be increased.
+ * Example:
+ * 0,1,2,3,4 - indexes
+ * remove 2 index
+ * new sequence:
+ * 0,1,2,3,4 , where are 0 = 0, 1 = 1, 3 = 2, 4 = 3.
+ */
+ virtual void RemoveGeometryById(CORBA::Long theId);
+
+
+ /*!
+ * Sets geometry of mesh as family on entity
+ */
+ virtual void SetFamilyOnEntity(const char* theMeshName,
+ const VISU::Entity theEntity,
+ const char* theFamilyName);
+
+ /*!
+ * Sets geometry of mesh as mesh on entity
+ */
+ virtual void SetMeshOnEntity(const char* theMeshName,
+ const VISU::Entity theEntity);
+
+
+ /*!
+ * Sets scalars as scalar map
+ */
+ virtual void SetScalarMap(const char* theMeshName,
+ const VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theStampsNum);
+
+ /*!
+ * Get number of geometries.
+ */
+ CORBA::Long GetNumberOfGeom();
+
+
+ /*!
+ * Get group names.
+ */
+ string_array* getGroupNames();
+
+ /*!
+ * Sets scalars as scalar map
+ */
+ void SetScalarMap(VISU_PipeLine* thePipeLine);
+
+ /*!
+ * Removes all geometries.
+ */
+ virtual void RemoveAllGeom();
+
+
+ /*! Warning!
+ * see \a myGeomNameEntityList
+ */
+ virtual CORBA::Long GetMeshGeometryPlace(CORBA::Long theId){return CORBA::Long(1);};// must bee filled
+
+ /*!
+ * Return true, if group is good, esle false.
+ * May be used, if SetScalarMap(...) olready .
+ */
+ bool CheckGroup(const char* theGroupName);
+
+ };
+
+}
+
+#endif
theIsAtOnce = true;
if(Build(SALOMEDS::SObject::_nil(),theIsAtOnce)){
+
+ // Set icon
+ SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
+
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributePixMap_var aPixmap;
+
+ anAttr = aStudyBuilder->FindOrCreateAttribute( mySObject, "AttributePixMap" );
+ aPixmap = SALOMEDS::AttributePixMap::_narrow( anAttr );
+ aPixmap ->SetPixMap("ICON_TREE_RESULT");
+
if(theIsBuildAll)
return BuildAll();
return true;
}
-
+
return false;
}
#include "VISU_ScalarMapOnDeformedShapePL.hxx"
#include "VISU_Result_i.hh"
-#include "VISU_ScalarMap_i.hh"
#include "VISU_ScalarMapOnDeformedShape_i.hh"
#include "VISU_Convertor.hxx"
#include "VISU_ScalarMapAct.h"
{
bool aResult = false;
try{
- aResult = VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false);
+ aResult = TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false);
if(isMemoryCheck && aResult){
const VISU::PField aField = theResult->GetInput()->GetField(theMeshName,(VISU::TEntity)theEntity,theFieldName);
if(aField->myNbComp <= 1)
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
+ TSuperClass(theResult,theAddToStudy),
myScalarMapOnDeformedShapePL(NULL),
myScalarIteration(1)
{
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
+ TSuperClass(theResult,theSObject),
myScalarMapOnDeformedShapePL(NULL),
myScalarIteration(1)
{
TSuperClass::DoHook();
}
+const char*
+VISU::ScalarMapOnDeformedShape_i
+::GetIconName()
+{
+ if (!GetNumberOfGeom())
+ return "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE";
+ else
+ return "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE_GROUPS";
+}
+
VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::CreateActor:"<<__LINE__<<endl;
std::string VISU::ScalarMapOnDeformedShape_i::GetScalarMeshName(){
return myScalarMeshName;
}
+char* VISU::ScalarMapOnDeformedShape_i::GetScalarCMeshName(){
+ return &this->GetScalarMeshName()[0];
+}
void VISU::ScalarMapOnDeformedShape_i::SetScalarFieldName(const char* theName){
myScalarFieldName = theName;
}
+
std::string VISU::ScalarMapOnDeformedShape_i::GetScalarFieldName(){
return myScalarFieldName;
}
+char* VISU::ScalarMapOnDeformedShape_i::GetScalarCFieldName(){
+ return &this->GetScalarFieldName()[0];
+}
+
void VISU::ScalarMapOnDeformedShape_i::SetScalarIteration(const int theValue){
myScalarIteration = theValue;
}
return myScalarIteration;
}
+CORBA::Long VISU::ScalarMapOnDeformedShape_i::GetScalarLIteration(){
+ return CORBA::Long(this->GetScalarIteration());
+}
+
void VISU::ScalarMapOnDeformedShape_i::SetScalarEntity(const VISU::TEntity theValue){
myScalarEntity = theValue;
}
#ifndef VISU_ScalarMapOnDeformedShape_i_HeaderFile
#define VISU_ScalarMapOnDeformedShape_i_HeaderFile
-#include "VISU_ScalarMap_i.hh"
+#include "VISU_PrsMerger_i.hh"
class VISU_ScalarMapOnDeformedShapePL;
//! Class of Scalar Map on Deformed Shape presentation.
class ScalarMapOnDeformedShape_i : public virtual POA_VISU::ScalarMapOnDeformedShape,
- public virtual ScalarMap_i
+ public virtual PrsMerger_i
{
static int myNbPresent;
ScalarMapOnDeformedShape_i();
public:
- typedef ScalarMap_i TSuperClass;
+ typedef PrsMerger_i TSuperClass;
explicit
ScalarMapOnDeformedShape_i(Result_i* theResult,
void
DoHook();
+ virtual
+ const char*
+ GetIconName();
+
VISU_ScalarMapOnDeformedShapePL *myScalarMapOnDeformedShapePL;
SALOMEDS::Color myColor;
bool myIsColored;
virtual void SetScalarFieldName(const char* theName);
virtual std::string GetScalarFieldName();
+ virtual char* GetScalarCFieldName();
virtual void SetScalarIteration(const int theValue);
virtual int GetScalarIteration();
+ virtual CORBA::Long GetScalarLIteration();
virtual void SetScalarMeshName(const char* theName);
virtual std::string GetScalarMeshName();
+ virtual char* GetScalarCMeshName();
virtual void SetScalarEntity(const VISU::TEntity theValue);
virtual VISU::TEntity GetScalarEntity();
virtual void SetScalarEEntity(const VISU::Entity theValue);
const char* theFieldName, int theIteration, int isMemoryCheck)
{
try{
- if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false))
+ if(!TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false))
return 0;
VISU::PIDMapper anIDMapper =
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
+ PrsMerger_i(theResult,theAddToStudy),
DeformedShape_i(theResult,theAddToStudy),
myStreamLinesPL(NULL),
myAppendFilter(vtkAppendFilter::New())
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
+ PrsMerger_i(theResult,theSObject),
DeformedShape_i(theResult,theSObject),
myStreamLinesPL(NULL),
myAppendFilter(vtkAppendFilter::New())
DeformedShape_i::DoHook();
}
+const char*
+VISU::StreamLines_i
+::GetIconName()
+{
+ if (!GetNumberOfGeom())
+ return "ICON_TREE_STREAM_LINES";
+ else
+ return "ICON_TREE_STREAM_LINES_GROUPS";
+}
void VISU::StreamLines_i::Update() {
SetSource();
protected:
virtual void DoHook();
+
+ virtual const char* GetIconName();
+
virtual void SetSource(VISU::Prs3d_ptr thePrs3d);
virtual void SetSource(VISU::Prs3d_i* thePrs3d);
virtual void SetSource();
// mpv (PAL5357): reference attributes are unnecessary now
//SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
//Builder->Addreference( refSO, SO );
- }
+ }
+
+ // Set icon
+ SALOMEDS::AttributePixMap_var aPixmap;
+
+ anAttr = Builder->FindOrCreateAttribute( mySObj, "AttributePixMap" );
+ aPixmap = SALOMEDS::AttributePixMap::_narrow( anAttr );
+ aPixmap->SetPixMap("ICON_TREE_TABLE");
+
return this;
}
return NULL;
true );
// create SObject referenced to real table object
mySObj = SALOMEDS::SObject::_duplicate(myStudy->FindObjectID(anEntry.c_str()));
+
+ // Set icon
+ SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributePixMap_var aPixmap;
+
+ anAttr = aStudyBuilder->FindOrCreateAttribute( mySObj, "AttributePixMap" );
+ aPixmap = SALOMEDS::AttributePixMap::_narrow( anAttr );
+ aPixmap ->SetPixMap("ICON_TREE_CURVE");
}
return this;
}
aComment.latin1(),
true );
mySObj = SALOMEDS::SObject::_duplicate(myStudy->FindObjectID(anEntry.c_str()));
+
+ // Set icon
+ SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributePixMap_var aPixmap;
+
+ anAttr = aStudyBuilder->FindOrCreateAttribute( mySObj, "AttributePixMap" );
+ aPixmap = SALOMEDS::AttributePixMap::_narrow( anAttr );
+ aPixmap ->SetPixMap("ICON_TREE_CONTAINER");
}
return this;
}
#include "VISU_Result_i.hh"
#include "VISU_Prs3d_i.hh"
#include "VISU_Mesh_i.hh"
-#include "VISU_ScalarMap_i.hh"
+#include "VISU_PrsMerger_i.hh"
#include "VISU_IsoSurfaces_i.hh"
#include "VISU_DeformedShape_i.hh"
#include "VISU_ScalarMapOnDeformedShape_i.hh"
FieldData aNewData;
aNewData.myField = theField;
aNewData.myNbFrames = 0;
- aNewData.myPrsType = VISU::TSCALARMAP;
+ aNewData.myPrsType = VISU::TPRSMERGER;
aNewData.myOffset[0] = aNewData.myOffset[1] = aNewData.myOffset[2] = 0;
VISU::Storable::TRestoringMap aMap = getMapOfValue(aNewData.myField);
if(VISU::Storable::FindValue(aMap,"myComment") != QString("FIELD"))
int aRangeType = VISU::GetResourceMgr()->integerValue("VISU" , "scalar_range_type", 0);
if( aRangeType != 1 ){
for(long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++) {
- if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(theData.myPrs[aFrameId])){
+ if (VISU::PrsMerger_i* aPrs = dynamic_cast<VISU::PrsMerger_i*>(theData.myPrs[aFrameId])){
aPrs->SetRange(aMin, aMax);
aPrs->SetOffset(theData.myOffset);
}
using namespace VISU;
switch (aData.myPrsType) {
- case VISU::TSCALARMAP: // ScalarMap
- GeneratePresentations<ScalarMap_i>(myStudy,
+ case VISU::TPRSMERGER: // ScalarMap
+ GeneratePresentations<PrsMerger_i>(myStudy,
aData,
aResult,
isRangeDefined(),
{
std::string aPrsCmt;
switch (thePrsType) {
- case VISU::TSCALARMAP:
- aPrsCmt = VISU::ScalarMap_i::myComment;
+ case VISU::TPRSMERGER:
+ aPrsCmt = VISU::PrsMerger_i::myComment;
break;
case VISU::TISOSURFACE:
aPrsCmt = VISU::IsoSurfaces_i::myComment;
string aStr = aName->Value();
QString strName (aStr.c_str());
- if (strName == VISU::ScalarMap_i::myComment.c_str())
- aData.myPrsType = VISU::TSCALARMAP;
+ if (strName == VISU::PrsMerger_i::myComment.c_str())
+ aData.myPrsType = VISU::TPRSMERGER;
else if (strName == VISU::IsoSurfaces_i::myComment.c_str())
aData.myPrsType = VISU::TISOSURFACE;
else if (strName == VISU::CutPlanes_i::myComment.c_str())
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
+ PrsMerger_i(theResult,theAddToStudy),
DeformedShape_i(theResult,theAddToStudy),
myVectorsPL(NULL)
{
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
+ PrsMerger_i(theResult,theSObject),
DeformedShape_i(theResult,theSObject),
myVectorsPL(NULL)
{
}
+const char*
+VISU::Vectors_i
+::GetIconName()
+{
+ if (!GetNumberOfGeom())
+ return "ICON_TREE_VECTORS";
+ else
+ return "ICON_TREE_VECTORS_GROUPS";
+}
+
+
VISU_PipeLine* VISU::Vectors_i::GetPipeLine(){
VISU_PipeLine* aPipeLine = VISU_VectorsPL::New();
aPipeLine->SetIDMapper(myPipeLine->GetIDMapper());
protected:
virtual void DoHook();
+
+ virtual const char* GetIconName();
+
virtual VISU_PipeLine* GetPipeLine();
VISU_VectorsPL *myVectorsPL;
aPrsObj.RemoveFromStudy()
else :
aVISUObjList.append(aPrsObj)
+
+ if HasValue(thePrsTypeList,VISU.TGAUSSPOINTS) :
+ print " Creating GaussPointsOnField",
+ aPrsObj = theVisu.GaussPointsOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
+ if aPrsObj is None : print "Error"
+ else :
+ print ",OK"
+ theView.DisplayOnly(aPrsObj)
+ theView.FitAll()
+ aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TGAUSSPOINTS." + thePictureExt
+ aPictureName = re.sub("\s+","_", aPictureName)
+ theView.SavePicture(aPictureName)
+ if theIsAutoDelete :
+ aPrsObj.RemoveFromStudy()
+ pass
+ else :
+ aVISUObjList.append(aPrsObj)
+ pass
+ pass
+ pass
return aVISUObjList
return anObj
-def dump_vetctors_parameters(theObject):
+def dump_vectors_parameters(theObject):
dump_deformedshape_parameters(theObject)
dump_scalarmap_parameters(theObject)
print "GetNbSurfaces() = "+ str(theObject.GetNbSurfaces())
+# ----------------------------
+# SCALAR MAP ON DEFORMED SHAPE
+# ----------------------------
+def dump_scalarmapondeformedshape_parameters(theObject):
+ dump_scalarmap_parameters(theObject)
+ print "GetScale() =", theObject.GetScale()
+ print "GetScalarCMeshName ()=|",theObject.GetScalarCMeshName(),"|"
+ print "GetScalarCFieldName()=|",theObject.GetScalarCFieldName(),"|"
+ print "GetScalarEEntity() =",theObject.GetScalarEEntity()
+ print "GetScalarLIteration()=",theObject.GetScalarLIteration()
+ pass
+
+def try_scalarmapondeformedshape_parameters(thePattern):
+
+ if thePattern is None : return None
+ import copy
+ import random
+
+ anObj = try_scalarmap_parameters(thePattern)
+
+ # --- SCALING ---
+ print
+ anObj.SetScale( anObj.GetScale()/random.random()*random.randint(1,10))
+
+ # --- Scalar Field ---
+ # not implemented yet.
+
+ return anObj
+# ----------------------
+# PLOT 3D
+# ----------------------
+def dump_plot3d_parameters(theObject):
+ dump_scalarmap_parameters(theObject)
+ print "GetOrientationType()=",str(theObject.GetOrientationType())
+ print "GetRotateX()=",theObject.GetRotateX()
+ print "GetRotateY()=",theObject.GetRotateY()
+ print "GetPlanePosition()=",theObject.GetPlanePosition()
+ print "IsPositionRelative()=",theObject.IsPositionRelative()
+ print "GetScaleFactor()=",theObject.GetScaleFactor()
+ print "GetIsContourPrs()=",theObject.GetIsContourPrs()
+ print "GetNbOfContours()=",theObject.GetNbOfContours()
+ pass
+
+def try_plot3d_parameters(thePattern):
+ if thePattern is None : return None
+ import random
+
+ anObj = try_scalarmap_parameters(thePattern)
+
+ ORIENT = [VISU.Plot3D.XY, VISU.Plot3D.YZ, VISU.Plot3D.ZX]
+
+ theXAngle = random.random()*random.randint(-180,180)
+ theYAngle = random.random()*random.randint(-180,180)
+
+ # ORIENTATION and ANGLES
+ anObj.SetOrientation(ORIENT[random.randint(0,2)],theXAngle,theYAngle)
+
+ # Plane position (revative)
+ anObj.SetPlanePosition(random.random(),1)
+
+ # SCALE FACTOR
+ anObj.SetScaleFactor(random.random()*random.randint(-10000,10000))
+
+ # CONTOUR PRS
+ anObj.SetContourPrs(random.randint(0,1))
+ if anObj.GetIsContourPrs():
+ anObj.SetNbOfContours(random.randint(1,999))
+ pass
+
+ pass
+
+# ----------------------
+# Gauss points
+# ----------------------
+def dump_gausspoints_parameters(theObject):
+
+ print "\tGetScalarMode() = " + str(anObj.GetScalarMode())
+ print "\tGetMin() = " + str(anObj.GetMin()) + " GetMax() = " + str (anObj.GetMax())
+ print "\tGetPosX() = ", str(anObj.GetPosX()) + " GetPosY() = ", str(anObj.GetPosY())
+ print "\tGetWidth() = ", str ( anObj.GetWidth()) + " GetHeight() = " + str(anObj.GetHeight())
+ print "\tGetNbColors() = " + str(anObj.GetNbColors())
+ print "\tGetLabels() = " + str(anObj.GetLabels())
+ print "\tGetTitle() = " + str(anObj.GetTitle())
+ pass
+
+def try_plot3d_parameters(thePattern):
+ if thePattern is None : return None
+ import random
+
+ pass
# ----------------------
# TABLES AND CURVES