img_whs3 { border:none; width:294px; height:192px; float:none; border-style:none; }\r
p.whs4 { margin-left:40px; font-style:normal; font-family:'Times New Roman' , serif; color:#000000; }\r
h4.whs5 { margin-left:48px; }\r
-img_whs6 { border:none; width:427px; height:364px; float:none; border-style:none; }\r
+img_whs6 { border:none; width:547px; height:364px; float:none; }\r
ul.whs7 { list-style:disc; }\r
p.whs8 { margin-left:38px; }\r
p.whs9 { font-style:italic; margin-left:94px; }\r
h4.whs10 { font-weight:normal; margin-left:48px; }\r
-p.whs11 { margin-left:40px; }\r
-p.whs12 { margin-left:40px; font-family:'Times New Roman' , serif; font-style:normal; }\r
-p.whs13 { margin-left:0px; font-family:'Times New Roman' , serif; font-weight:bold; }\r
-p.whs14 { font-weight:bold; margin-left:48px; }\r
-p.whs15 { font-weight:bold; margin-left:0px; }\r
-p.whs16 { margin-left:40px; font-style:italic; font-family:'Times New Roman' , serif; }\r
-p.whs17 { background-image:url('../texture_horiz_ltbluebubbles.jpg'); }\r
-img_whs18 { border:none; width:36px; height:38px; float:none; border-style:none; }\r
+img_whs11 { border:none; width:553px; height:387px; float:none; }\r
+p.whs12 { margin-left:40px; }\r
+p.whs13 { margin-left:40px; font-family:'Times New Roman' , serif; font-style:normal; }\r
+p.whs14 { margin-left:0px; font-family:'Times New Roman' , serif; font-weight:bold; }\r
+p.whs15 { font-weight:bold; margin-left:48px; }\r
+img_whs16 { border:none; width:427px; height:364px; float:none; border-style:none; }\r
+p.whs17 { font-weight:bold; margin-left:0px; }\r
+p.whs18 { margin-left:40px; font-style:italic; font-family:'Times New Roman' , serif; }\r
+p.whs19 { background-image:url('../texture_horiz_ltbluebubbles.jpg'); }\r
+img_whs20 { border:none; width:36px; height:38px; float:none; border-style:none; }\r
-->\r
</style><script type="text/javascript" language="JavaScript">\r
<!--\r
if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
{\r
var strNSS = "<style type='text/css'>";\r
- strNSS += "p.whs13 {margin-left:1pt; }";\r
- strNSS += "p.whs15 {margin-left:1pt; }";\r
+ strNSS += "p.whs14 {margin-left:1pt; }";\r
+ strNSS += "p.whs17 {margin-left:1pt; }";\r
strNSS +="</style>";\r
document.write(strNSS);\r
}\r
The chosen element will be highlighted and its attributes will be displayed \r
in this dialog box: </p>\r
\r
-<h4 class="whs5"><img src="../pics/dataonelements1.png" x-maintain-ratio="TRUE" width="427px" height="364px" border="0" class="img_whs6"></h4>\r
+<h4 class="whs5"><img src="../pics/dataonelements1.png" x-maintain-ratio="TRUE" width="547px" height="364px" border="0" class="img_whs6"></h4>\r
\r
<p><span style="font-weight: normal;">You can get the following information \r
about</span> Points<span style="font-weight: normal;">:</span></p>\r
\r
<li class=kadov-p><p class="whs8">Coordinates of the \r
point in 3d space</p></li>\r
+ \r
+ <li class=kadov-p><p class="whs8">Indexes (i,j,k) of \r
+ the point (for structured meshes only)</p></li>\r
</ul>\r
\r
<p class="whs9"> </p>\r
\r
-<h4 class="whs10"><img src="../pics/dataonelements2.png" x-maintain-ratio="TRUE" width="427px" height="364px" border="0" class="img_whs6"></h4>\r
+<h4 class="whs10"><img src="../pics/dataonelements2.png" x-maintain-ratio="TRUE" width="553px" height="387px" border="0" class="img_whs11"></h4>\r
\r
<p><span style="font-weight: normal;">The following information about</span> \r
Cells <span style="font-weight: normal;">is available:</span></p>\r
\r
<ul type="disc" class="whs7">\r
\r
- <li class=kadov-p><p class="whs11">Mesh name</p></li>\r
+ <li class=kadov-p><p class="whs12">Mesh name</p></li>\r
\r
- <li class=kadov-p><p class="whs11">Field name</p></li>\r
+ <li class=kadov-p><p class="whs12">Field name</p></li>\r
\r
- <li class=kadov-p><p class="whs12">ID Number of the cell</p></li>\r
+ <li class=kadov-p><p class="whs13">ID Number of the cell</p></li>\r
\r
- <li class=kadov-p><p class="whs12">Scalar value applied \r
+ <li class=kadov-p><p class="whs13">Scalar value applied \r
to the cell (if any)</p></li>\r
\r
- <li class=kadov-p><p class="whs12">Vector value applied \r
+ <li class=kadov-p><p class="whs13">Vector value applied \r
to the cell (if any)</p></li>\r
\r
- <li class=kadov-p><p class="whs12">Attributes of the \r
+ <li class=kadov-p><p class="whs13">Attributes of the \r
points forming this cell (in table layout)</p></li>\r
</ul>\r
\r
-<p class="whs13"> </p>\r
+<p class="whs14"> </p>\r
\r
-<p class="whs14"><img src="../pics/dataonelements3.png" x-maintain-ratio="TRUE" width="427px" height="364px" border="0" class="img_whs6"></p>\r
+<p class="whs15"><img src="../pics/dataonelements3.png" x-maintain-ratio="TRUE" width="427px" height="364px" border="0" class="img_whs16"></p>\r
\r
-<p class="whs13"> </p>\r
+<p class="whs14"> </p>\r
\r
-<p class="whs15"><span style="font-weight: normal;">An</span> \r
+<p class="whs17"><span style="font-weight: normal;">An</span> \r
Actor (<span style="font-weight: normal;">any 3D object (presentation \r
of a submesh, field presentation) displayed in the viewer</span>) <span \r
style="font-weight: normal;">possesses the following characteristics:</span></p>\r
\r
<ul type="disc" class="whs7">\r
\r
- <li class=kadov-p><p class="whs11"><span style="font-style: italic;"><I>Mesh \r
+ <li class=kadov-p><p class="whs12"><span style="font-style: italic;"><I>Mesh \r
name</I></span></p></li>\r
\r
- <li class=kadov-p><p class="whs11"><span style="font-style: italic;"><I>Field \r
+ <li class=kadov-p><p class="whs12"><span style="font-style: italic;"><I>Field \r
name</I></span></p></li>\r
\r
- <li class=kadov-p><p class="whs16">Coordinates \r
+ <li class=kadov-p><p class="whs18">Coordinates \r
of the object in 3d space</p></li>\r
\r
- <li class=kadov-p><p class="whs16">Size \r
+ <li class=kadov-p><p class="whs18">Size \r
of the object (expressed as the extent along the coordinates)</p></li>\r
</ul>\r
\r
-<p class="whs16"> </p>\r
+<p class="whs18"> </p>\r
\r
-<p class="whs17"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs18">Using this dialog box, you can examine the attributes of a \r
+<p class="whs19"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs20">Using this dialog box, you can examine the attributes of a \r
definite point or cell, selected by its ID number. For that, you should \r
only enter an ID number of a definite point or cell in the <span style="font-weight: bold;"><B>ID \r
</B></span>field, the attributes of this point or cell will be immediately \r
EGeometry aEGeom = anIter->first;
vtkIdType aVGeom = VISUGeom2VTK(aEGeom);
PSubMeshImpl aSubMesh = anIter->second;
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ aSubMesh->myIsStructured = aMesh->myIsStructured;
+ aSubMesh->myType = aMesh->myType;
+ aSubMesh->myGrilleStructure = aMesh->myGrilleStructure;
+ aSubMesh->myObjID2StructureID = aMesh->myObjID2StructureID;
+ //ENK: 23.11.2006
const TVTKSource& aSource = aSubMesh->GetSource();
aSource->SetPoints(GetPoints(aMesh));
GetCellsOnSubMesh(aSource,aMeshOnEntity,aSubMesh,aVGeom);
aSubMeshArr[anID] = aSubMesh;
}
aMeshOnEntity->myNamedPointCoords = aMesh->myNamedPointCoords;
-
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ aMeshOnEntity->myIsStructured = aMesh->myIsStructured;
+ aMeshOnEntity->myType = aMesh->myType;
+ aMeshOnEntity->myGrilleStructure = aMesh->myGrilleStructure;
+ aMeshOnEntity->myObjID2StructureID = aMesh->myObjID2StructureID;
+ //ENK: 23.11.2006
aMeshOnEntity->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
GetCellsOnFamily(aSource,aMeshOnEntity,aFamily);
aFamily->myNamedPointCoords = aMesh->myNamedPointCoords;
-
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ aFamily->myIsStructured = aMesh->myIsStructured;
+ aFamily->myType = aMesh->myType;
+ aFamily->myGrilleStructure = aMesh->myGrilleStructure;
+ aFamily->myObjID2StructureID = aMesh->myObjID2StructureID;
+ //ENK: 23.11.2006
aFamily->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
aFamilyArr[anID] = aFamily;
}
aGroup->myNamedPointCoords = aMesh->myNamedPointCoords;
-
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ aGroup->myIsStructured = aMesh->myIsStructured;
+ aGroup->myType = aMesh->myType;
+ aGroup->myGrilleStructure = aMesh->myGrilleStructure;
+ aGroup->myObjID2StructureID = aMesh->myObjID2StructureID;
+ //ENK: 23.11.2006
aGroup->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
aValForTime->myProfile,
aVTKMeshOnEntity->myEntity);
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ anIDMapperFilter->myIsStructured = aMesh->myIsStructured;
+ anIDMapperFilter->myType = aMesh->myType;
+ anIDMapperFilter->myGrilleStructure = aMesh->myGrilleStructure;
+ anIDMapperFilter->myObjID2StructureID = aMesh->myObjID2StructureID;
+ //ENK: 23.11.2006
anIDMapperFilter->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
typedef TVector<TConnect> TCell2Connect;
//! The class is responsible for mapping of cells of defined geometrical type
- struct TSubMeshImpl: virtual TSource
+ struct TSubMeshImpl: virtual TSource,
+ virtual TStructured // ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
{
//! To implement the TIDMapper::GetElemObjID
namespace VISU
{
+ //---------------------------------------------------------------
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ bool
+ TStructured
+ ::IsStructured() const
+ {
+ return myIsStructured;
+ }
+
+ TIdTypeVector
+ TStructured
+ ::GetStructure()
+ {
+ return myGrilleStructure;
+ }
+
+ TIdTypeVector
+ TStructured
+ ::GetIndexesOfNode(vtkIdType theNodeId)
+ {
+ TIdTypeVector aNullVec;
+ if(!IsStructured())
+ return aNullVec;
+ TObj2IdTypeVector::const_iterator aIter = myObjID2StructureID.find(theNodeId);
+ if(aIter!=myObjID2StructureID.end())
+ return aIter->second;
+ else
+ return aNullVec;
+ }
+
+ vtkIdType
+ TStructured
+ ::GetObjectIDByIndexes(TIdTypeVector theVec)
+ {
+ TObj2IdTypeVector::const_iterator aIter = myObjID2StructureID.begin();
+ for(;aIter!=myObjID2StructureID.end();aIter++){
+ if(theVec == aIter->second)
+ return aIter->first;
+ }
+ return -1;
+ }
+ //ENK: 23.11.2006
+
//---------------------------------------------------------------
vtkFloatingPointType*
TIDMapper
*/
#include "MED_SharedPtr.hxx"
+#include "MED_Vector.hxx"
#include "VTKViewer.h"
#include <string>
+#include <map>
class vtkUnstructuredGrid;
class vtkCell;
namespace VISU
{
using MED::SharedPtr;
+ using MED::TVector;
+
+ typedef TVector<vtkIdType> TIdTypeVector;
+ typedef std::map<vtkIdType,TIdTypeVector> TObj2IdTypeVector;
+
+ struct TStructured
+ {
+ TStructured():
+ myIsStructured(false),
+ myType(true)
+ {}
+
+ virtual
+ bool
+ IsStructured() const;
+
+ /*!
+ * Get structure of grille
+ * see also MED::TGrilleInfo::GetGrilleStructure
+ * see also MED::TGrilleInfo::GetNbIndexes
+ */
+ virtual TIdTypeVector
+ GetStructure();
+
+ /*!
+ * Gets i,j,k by object id
+ * return -1, if not found
+ */
+ virtual TIdTypeVector
+ GetIndexesOfNode(vtkIdType theNodeId);
+
+ /*!
+ * Gets object id by i,j,k
+ * return -1, if not found
+ */
+ virtual vtkIdType
+ GetObjectIDByIndexes(TIdTypeVector theVec);
+
+ public:
+ bool myIsStructured; //!< To define mesh type (structured - true, non structured - false)
+ bool myType; //!< To define structured mesh is polair
+
+ /*!provides grille structure for structured grid.
+ * Example: {3,4,5}, 3 nodes in X axe, 4 nodes in Y axe, ...
+ */
+ TIdTypeVector myGrilleStructure;
+
+ TObj2IdTypeVector myObjID2StructureID;//!< map of object id to i,j,k ids of structured grid nodes
+
+ };
+
//---------------------------------------------------------------
//! Defines a basic class for intemediate data structures
- struct TBaseStructure
+ struct TBaseStructure: virtual TStructured
{
//! Just to provide possibility of dynamic navigation through the class hierarchy
virtual ~TBaseStructure()
const std::string& aMeshName = theMesh->myName;
TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
MED::TEntityInfo::const_iterator anEntityIter = theEntityInfo.begin();
+
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ int iMax,jMax,kMax;
+ iMax=jMax=kMax=0;
+
+ MED::TIntVector aIntVec;
+ if(theGrilleInfo->GetGrilleType()!=MED::eGRILLE_STANDARD)
+ for(int i=0;i<theMesh->myDim;i++)
+ aIntVec.push_back(theGrilleInfo->GetNbIndexes(i));
+ else
+ aIntVec = theGrilleInfo->GetGrilleStructure();
+
+ theMesh->myGrilleStructure = aIntVec;
+
+ switch((theMesh->GetStructure()).size()){
+ case 3: kMax=theMesh->GetStructure()[2];
+ case 2: jMax=theMesh->GetStructure()[1];
+ case 1: iMax=theMesh->GetStructure()[0];
+ }
+
+ int iii=0;
+ TVectorID aIndexes;
+ switch(theMesh->myDim){
+ case 1:
+ for(int i=1;i<=iMax;i++)
+ (theMesh->myObjID2StructureID[i-1]).push_back(i);
+ break;
+ case 2:
+ for(int j=1;j<=jMax;j++)
+ for(int i=1;i<=iMax;i++){
+ (theMesh->myObjID2StructureID[iii]).push_back(i);
+ (theMesh->myObjID2StructureID[iii]).push_back(j);
+ iii++;
+ }
+ break;
+ case 3:
+ for(int k=1;k<=kMax ;k++)
+ for(int j=1;j<=jMax;j++)
+ for(int i=1;i<=iMax;i++)
+ {
+ (theMesh->myObjID2StructureID[iii]).push_back(i);
+ (theMesh->myObjID2StructureID[iii]).push_back(j);
+ (theMesh->myObjID2StructureID[iii]).push_back(k);
+ iii++;
+ }
+ }
+ //ENK: 23.11.2006
+
for(; anEntityIter != theEntityInfo.end(); anEntityIter++){
const MED::EEntiteMaillage& aMEntity = anEntityIter->first;
const MED::TGeom2Size& aGeom2Size = anEntityIter->second;
aMesh->myNbPoints = aGrilleInfo->GetNbNodes();
aMesh->myEntityInfo = anEntityInfo;
-
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ aMesh->myIsStructured = true;
+ aMesh->myType = (MED::eGRILLE_POLAIRE == aGrilleInfo->GetGrilleType());
+ //ENK: 23.11.2006
#ifndef _DEXCEPT_
try{
#endif
VISU::RangeStepAndValidator(SpinBoxRot1, -180.0, 180.0, 1, 3);
VISU::RangeStepAndValidator(SpinBoxRot2, -180.0, 180.0, 1, 3);
- ComboBoxOrientation->insertItem(tr("PARALLEL_XOY_COMBO_ITEM"));
- ComboBoxOrientation->insertItem(tr("PARALLEL_YOZ_COMBO_ITEM"));
- ComboBoxOrientation->insertItem(tr("PARALLEL_ZOX_COMBO_ITEM"));
-
SpinBoxDistance->setValue(0.5);
myPrs3d = 0;
myIsSelectPlane = false;
onSelectionChanged();
+ ComboBoxOrientation->insertItem(tr("PARALLEL_XOY_COMBO_ITEM"));
+ ComboBoxOrientation->insertItem(tr("PARALLEL_YOZ_COMBO_ITEM"));
+ ComboBoxOrientation->insertItem(tr("PARALLEL_ZOX_COMBO_ITEM"));
+
+
// signals and slots connections :
connect(ComboBoxPlanes , SIGNAL(activated(int)) , this, SLOT(onSelectPlane(int)));
connect(buttonNew , SIGNAL(clicked()) , this, SLOT(ClickOnNew()));
ButtonGroupIJKAxis ->setEnabled(anIsControlsEnable);
SpinBoxIJKIndex ->setEnabled(anIsControlsEnable);
CheckBoxIJKPlaneReverse->setEnabled(anIsControlsEnable);
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ if(myPrs3d)
+ if(myPrs3d->GetPL()->GetIDMapper()->IsStructured()){
+ VISU::TIdTypeVector aVec = myPrs3d->GetPL()->GetIDMapper()->GetStructure();
+ switch(aVec.size()){
+ case 1:
+ ButtonGroupIJKAxis->find(0)->setEnabled(true);
+ ButtonGroupIJKAxis->find(1)->setEnabled(false);
+ ButtonGroupIJKAxis->find(2)->setEnabled(false);
+ break;
+ case 2:
+ ButtonGroupIJKAxis->find(0)->setEnabled(true);
+ ButtonGroupIJKAxis->find(1)->setEnabled(true);
+ ButtonGroupIJKAxis->find(2)->setEnabled(false);
+ break;
+ case 3:
+ ButtonGroupIJKAxis->find(0)->setEnabled(true);
+ ButtonGroupIJKAxis->find(1)->setEnabled(true);
+ ButtonGroupIJKAxis->find(2)->setEnabled(true);
+ break;
+ }
+ }
+ //ENK: 23.11.2006
}
//=================================================================================
double maxDot = 0;
const vector<vtkFloatingPointType> *curValues, *values = 0;
VISU::Result_i* result = myPrs3d->GetResult();
- for (i = 0; i < 3; ++i) {
+ int aNbAxes = 3;
+ if(myPrs3d->GetPL()->GetIDMapper()->IsStructured() &&
+ !myPrs3d->GetPL()->GetIDMapper()->myType)
+ aNbAxes = (myPrs3d->GetPL()->GetIDMapper()->GetStructure()).size();
+ for (i = 0; i < aNbAxes; ++i) {
VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) i;
curValues = result->GetAxisInfo(myPrs3d->GetMeshName(), axis, dir);
if (curValues) {
double dot = normal * dir;
- if (Abs(dot) > Abs(maxDot)) {
+ //ENK: 23.11.2006 - PAL13176
+ if(i==0){
+ maxDot = dot;
+ gridDir = dir;
+ values = curValues;
+ gridAxId = i;
+ } else if (Abs(dot) >= Abs(maxDot)) {
maxDot = dot;
gridDir = dir;
values = curValues;
gridAxId = i;
}
+ //ENK: 23.11.2006
}
if (Abs (planeNormal[ maxAx ]) < Abs (planeNormal[ i ]))
maxAx = i;
myVectorValLbl = new QLabel ("", aDataGrp);
myVectorValLbl->setMinimumWidth(150);
- QGroupBox* aCoordGrp = new QGroupBox (2, Qt::Horizontal, "Coordinates", myPointsPane);
+ QGroupBox* aCoordGrp = new QGroupBox (4, Qt::Horizontal, "Coordinates", myPointsPane);
aCoordGrp->layout()->setSpacing(6);
new QLabel ("X:", aCoordGrp);
myXValLbl = new QLabel ("", aCoordGrp);
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ new QLabel ("I:", aCoordGrp);
+ myIValLbl = new QLabel ("-", aCoordGrp);
+ //ENK: 23.11.2006
new QLabel ("Y:", aCoordGrp);
myYValLbl = new QLabel ("", aCoordGrp);
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ new QLabel ("J:", aCoordGrp);
+ myJValLbl = new QLabel ("-", aCoordGrp);
+ //ENK: 23.11.2006
new QLabel ("Z:",aCoordGrp );
myZValLbl = new QLabel ("", aCoordGrp);
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ new QLabel ("K:", aCoordGrp);
+ myKValLbl = new QLabel ("-", aCoordGrp);
+ //ENK: 23.11.2006
myWidgetStack->addWidget(myPointsPane, 0);
myListPoints = new QTable (myCellsPane);
myListPoints->setReadOnly(true);
- myListPoints->setNumCols(6);
+ myListPoints->setNumCols(9);
myListPoints->setNumRows(0);
myListPoints->setColumnWidth(0, 40);
myListPoints->setColumnWidth(1, 40);
myListPoints->setColumnWidth(2, 40);
myListPoints->setColumnWidth(3, 40);
+ myListPoints->setColumnWidth(4, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ myListPoints->setColumnWidth(5, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ myListPoints->setColumnWidth(6, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
myListPoints->setSelectionMode(QTable::NoSelection);
QHeader* aHeader = myListPoints->horizontalHeader();
aHeader->setLabel( 0, "ID" );
aHeader->setLabel( 1, "X" );
aHeader->setLabel( 2, "Y" );
aHeader->setLabel( 3, "Z" );
- aHeader->setLabel( 4, "Scalar" );
- aHeader->setLabel( 5, "Vector" );
+ aHeader->setLabel( 4, "I" );//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ aHeader->setLabel( 5, "J" );//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ aHeader->setLabel( 6, "K" );//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ aHeader->setLabel( 7, "Scalar" );
+ aHeader->setLabel( 8, "Vector" );
aCellLayout->addWidget(myListPoints, 1, 0);
myIDValLbl->setText( QString::number(anID) );
myScalarValLbl->setText(getValue(aPntData, aVTKID));
myVectorValLbl->setText(getVector(aPntData, aVTKID));
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ const VISU::PIDMapper& aMapper = aPrs3d->GetPL()->GetIDMapper();
+ VISU::TIdTypeVector aVec = aMapper->GetIndexesOfNode(anID);
+ switch(aVec.size()){
+ case 3:
+ myKValLbl->setText(QString::number(aVec[2]));
+ case 2:
+ myJValLbl->setText(QString::number(aVec[1]));
+ case 1:
+ myIValLbl->setText(QString::number(aVec[0]));
+ break;
+ default:
+ myIValLbl->setText("-");
+ myJValLbl->setText("-");
+ myKValLbl->setText("-");
+ }
+ //ENK: 23.11.2006
}
break;
case 1:
myListPoints->setNumRows(aPointsMap.size());
PointsMap::const_iterator It = aPointsMap.begin();
+
+ const VISU::PIDMapper& aMapper = aPrs3d->GetPL()->GetIDMapper();
for (int i = 0; It != aPointsMap.end() && i < myListPoints->numRows(); It++, i++) {
myListPoints->verticalHeader()->setLabel(i, QString::number( i ));
int id = It->first;
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ VISU::TIdTypeVector aVec = aMapper->GetIndexesOfNode(id);
+ QString aI,aJ,aK;
+ aI = "-";
+ aJ = "-";
+ aK = "-";
+ switch(aVec.size()){
+ case 3:
+ aK = QString::number(aVec[2]);
+ case 2:
+ aJ = QString::number(aVec[1]);
+ case 1:
+ aI = QString::number(aVec[0]);
+ break;
+ }
+ //ENK: 23.11.2006
+
myListPoints->setText(i, 0, QString::number( id ));
vtkFloatingPointType* aCoord = It->second;
myListPoints->setText(i, 1, QString::number( aCoord[0] ));
myListPoints->setText(i, 2, QString::number( aCoord[1] ));
myListPoints->setText(i, 3, QString::number( aCoord[2] ));
- myListPoints->setText(i, 4, getValue(aPntData, id));
- myListPoints->setText(i, 5, getVector(aPntData, id));
+ myListPoints->setText(i, 4, aI);//ENK: 23.11.2006 - PAL13176
+ myListPoints->setText(i, 5, aJ);//ENK: 23.11.2006 - PAL13176
+ myListPoints->setText(i, 6, aK);//ENK: 23.11.2006 - PAL13176
+ myListPoints->setText(i, 7, getValue(aPntData, id));
+ myListPoints->setText(i, 8, getVector(aPntData, id));
}
}
} else {
myXValLbl->setText( "" );
myYValLbl->setText( "" );
myZValLbl->setText( "" );
+ myIValLbl->setText( "-" );//ENK: 23.11.2006 - PAL13176
+ myJValLbl->setText( "-" );//ENK: 23.11.2006 - PAL13176
+ myKValLbl->setText( "-" );//ENK: 23.11.2006 - PAL13176
myIDValLbl->setText( "" );
myScalarValLbl->setText("");
myVectorValLbl->setText("");
QLabel* myXValLbl;
QLabel* myYValLbl;
QLabel* myZValLbl;
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ QLabel* myIValLbl; //!< used for structured mesh selection
+ QLabel* myJValLbl; //!< used for structured mesh selection
+ QLabel* myKValLbl; //!< used for structured mesh selection
+ //ENK: 23.11.2006
QLineEdit* myIDValLbl;
QLabel* myScalarValLbl;
{
// check presence of theMeshName
const VISU::TMeshMap& meshMap = myInput->GetMeshMap();
- if ( meshMap.find( theMeshName ) == meshMap.end() ) {
+ PMesh theMesh;
+ VISU::TMeshMap::const_iterator aIter = meshMap.find( theMeshName );
+ if ( aIter == meshMap.end() ) {
MESSAGE("No mesh named " << theMeshName );
return components;
- }
-
- VISU::PIDMapper anIDMapper = myInput->GetMeshOnEntity(theMeshName,
- CELL_ENTITY);
- VISU::TVTKOutput* aMesh = anIDMapper->GetVTKOutput();
+ } else
+ theMesh = aIter->second;
- if ( !aMesh || aMesh->GetNumberOfCells() == 0 ) {
- MESSAGE( "No cells in the mesh: " << theMeshName );
- return components;
- }
+ if(!theMesh->IsStructured() || theMesh->myType){
- // define axis directions and min cell size in each direction
- const int nbAxes = 3;
- int iAx;
- gp_Vec axDirs[ nbAxes ];
- float minSize[3] = { FLT_MAX, FLT_MAX, FLT_MAX };
- bool axesComputed = false;
- for ( vtkIdType iCell = 0; iCell < aMesh->GetNumberOfCells(); ++iCell )
- {
- vtkCell* cell = aMesh->GetCell( iCell );
- int nbPnt = cell->GetNumberOfPoints();
- if ( nbPnt != 8 )
- continue;
- vtkPoints * points = cell->GetPoints();
- vtkFloatingPointType* coords[ 4 ];
- coords[0] = points->GetPoint( 0 );
- coords[1] = points->GetPoint( 1 );
- coords[2] = points->GetPoint( 3 );
- coords[3] = points->GetPoint( 4 );
- gp_Pnt p0( coords[0][0], coords[0][1], coords[0][2] );
- for ( iAx = 0; iAx < nbAxes; ++iAx )
- {
- vtkFloatingPointType* coo = coords[ iAx + 1 ];
- gp_Pnt p( coo[0], coo[1], coo[2] );
- // min size
- vtkFloatingPointType size = p0.SquareDistance( p );
- if ( size > FLT_MIN && size < minSize[ iAx ] )
- minSize[ iAx ] = size;
- // axis direction
- if ( !axesComputed ) {
- gp_Vec dir( p0, p );
- if ( dir.SquareMagnitude() <= DBL_MIN )
- break;
- axDirs[ iAx ] = dir;
- }
+ VISU::PIDMapper anIDMapper = myInput->GetMeshOnEntity(theMeshName,
+ CELL_ENTITY);
+
+ VISU::TVTKOutput* aMesh = anIDMapper->GetVTKOutput();
+
+ if ( !aMesh || aMesh->GetNumberOfCells() == 0 ) {
+ MESSAGE( "No cells in the mesh: " << theMeshName );
+ return components;
}
- if ( iAx == nbAxes )
- axesComputed = true;
- }
- if ( !axesComputed ) {
- MESSAGE("No good hexahedrons in the mesh: " << theMeshName );
- return components;
- }
-
- // compute axes dirs
- gInfo = & myMeshName2GridInfoMap[ theMeshName ];
- for ( iAx = 0; iAx < nbAxes; ++iAx )
- {
- int iPrev = ( iAx == 0 ) ? 2 : iAx - 1;
- int iNext = ( iAx == 2 ) ? 0 : iAx + 1;
- gInfo->myAxis[ iAx ] = axDirs[ iPrev ] ^ axDirs[ iNext ];
- }
-
- // get and sort intermediate component values - projections of nodes
- // on axis direction; define bnd box
- set< vtkFloatingPointType > comps[ 3 ];
- Bnd_Box box;
- vtkPoints * points = aMesh->GetPoints();
- vtkIdType iP, nbP = aMesh->GetNumberOfPoints();
- for ( iP = 0; iP < nbP; ++iP )
- {
- vtkFloatingPointType* coo = points->GetPoint( iP );
- gp_Pnt p( coo[0], coo[1], coo[2] );
- box.Add( p );
+
+ // define axis directions and min cell size in each direction
+ const int nbAxes = 3;
+ int iAx;
+ gp_Vec axDirs[ nbAxes ];
+ float minSize[3] = { FLT_MAX, FLT_MAX, FLT_MAX };
+ bool axesComputed = false;
+ for ( vtkIdType iCell = 0; iCell < aMesh->GetNumberOfCells(); ++iCell )
+ {
+ vtkCell* cell = aMesh->GetCell( iCell );
+ int nbPnt = cell->GetNumberOfPoints();
+ if ( nbPnt != 8 )
+ continue;
+ vtkPoints * points = cell->GetPoints();
+ vtkFloatingPointType* coords[ 4 ];
+ coords[0] = points->GetPoint( 0 );
+ coords[1] = points->GetPoint( 1 );
+ coords[2] = points->GetPoint( 3 );
+ coords[3] = points->GetPoint( 4 );
+ gp_Pnt p0( coords[0][0], coords[0][1], coords[0][2] );
+ for ( iAx = 0; iAx < nbAxes; ++iAx )
+ {
+ vtkFloatingPointType* coo = coords[ iAx + 1 ];
+ gp_Pnt p( coo[0], coo[1], coo[2] );
+ // min size
+ vtkFloatingPointType size = p0.SquareDistance( p );
+ if ( size > FLT_MIN && size < minSize[ iAx ] )
+ minSize[ iAx ] = size;
+ // axis direction
+ if ( !axesComputed ) {
+ gp_Vec dir( p0, p );
+ if ( dir.SquareMagnitude() <= DBL_MIN )
+ break;
+ axDirs[ iAx ] = dir;
+ }
+ }
+ if ( iAx == nbAxes )
+ axesComputed = true;
+ }
+ if ( !axesComputed ) {
+ MESSAGE("No good hexahedrons in the mesh: " << theMeshName );
+ return components;
+ }
+
+ // compute axes dirs
+ gInfo = & myMeshName2GridInfoMap[ theMeshName ];
+ for ( iAx = 0; iAx < nbAxes; ++iAx )
+ {
+ int iPrev = ( iAx == 0 ) ? 2 : iAx - 1;
+ int iNext = ( iAx == 2 ) ? 0 : iAx + 1;
+ gInfo->myAxis[ iAx ] = axDirs[ iPrev ] ^ axDirs[ iNext ];
+ cout << "myAxis["<<iAx<<"]:";
+ cout << "|" << (gInfo->myAxis[ iAx ]).X();
+ cout << "|" << (gInfo->myAxis[ iAx ]).Y();
+ cout << "|" << (gInfo->myAxis[ iAx ]).Z()<<"|";
+ }
+
+ // get and sort intermediate component values - projections of nodes
+ // on axis direction; define bnd box
+ set< vtkFloatingPointType > comps[ 3 ];
+ Bnd_Box box;
+ vtkPoints * points = aMesh->GetPoints();
+ vtkIdType iP, nbP = aMesh->GetNumberOfPoints();
+ for ( iP = 0; iP < nbP; ++iP )
+ {
+ vtkFloatingPointType* coo = points->GetPoint( iP );
+ gp_Pnt p( coo[0], coo[1], coo[2] );
+ box.Add( p );
+ for ( iAx = 0; iAx < nbAxes; ++iAx ) {
+ const gp_Dir& dir = gInfo->myAxis[ iAx ];
+ vtkFloatingPointType dot = dir.XYZ() * p.XYZ();
+ comps[ iAx ].insert( dot );
+ }
+ }
+
+ // find a range of projections of bnd box corners on each axis
+ vtkFloatingPointType range[3], firstValue[3];
+ double x[2],y[2],z[2];
+ box.Get(x[0],y[0],z[0],x[1],y[1],z[1]);
for ( iAx = 0; iAx < nbAxes; ++iAx ) {
- const gp_Dir& dir = gInfo->myAxis[ iAx ];
- vtkFloatingPointType dot = dir.XYZ() * p.XYZ();
- comps[ iAx ].insert( dot );
+ set< vtkFloatingPointType > bndComps;
+ const gp_Dir& dir = gInfo->myAxis[ iAx ];
+ for ( int iX = 0; iX < 2; ++iX ) {
+ for ( int iY = 0; iY < 2; ++iY ) {
+ for ( int iZ = 0; iZ < 2; ++iZ ) {
+ gp_Pnt p( x[ iX ], y[ iY ], z[ iZ ] );
+ vtkFloatingPointType dot = dir.XYZ() * p.XYZ();
+ bndComps.insert( dot );
+ }
+ }
+ }
+ firstValue[ iAx ] = *bndComps.begin();
+ range[ iAx ] = *bndComps.rbegin() - *bndComps.begin();
}
+
+ // compute component values
+ for ( iAx = 0; iAx < nbAxes; ++iAx )
+ {
+ list< vtkFloatingPointType > values;
+ int nbVals = 0;
+ set< vtkFloatingPointType >& comp = comps[ iAx ];
+ set< vtkFloatingPointType >::iterator val = comp.begin();
+ vtkFloatingPointType bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ];
+ vtkFloatingPointType tol = 0.1 * sqrt( minSize[ iAx ]) / rng;
+ for ( ; val != comp.end(); ++val ) {
+ vtkFloatingPointType value = ( *val - first ) / rng;
+ if ( value > bnd ) {
+ values.push_back( value );
+ bnd = value + tol;
+ nbVals++;
+ }
+ }
+ // store values in gInfo
+ vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ iAx ];
+ myComp.resize( nbVals );
+ list< vtkFloatingPointType >::iterator v = values.begin();
+ cout << "Components["<<iAx<<"]:";
+ for ( int i = 0; v != values.end(); ++v ){
+ myComp[ i++ ] = *v;
+ cout << "|" << *v;
+ }
+ cout << endl;
+ }
}
+ else {
+ //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
+ TVectorID aIndexes = theMesh->GetStructure();
- // find a range of projections of bnd box corners on each axis
- vtkFloatingPointType range[3], firstValue[3];
- double x[2],y[2],z[2];
- box.Get(x[0],y[0],z[0],x[1],y[1],z[1]);
- for ( iAx = 0; iAx < nbAxes; ++iAx ) {
- set< vtkFloatingPointType > bndComps;
- const gp_Dir& dir = gInfo->myAxis[ iAx ];
- for ( int iX = 0; iX < 2; ++iX ) {
- for ( int iY = 0; iY < 2; ++iY ) {
- for ( int iZ = 0; iZ < 2; ++iZ ) {
- gp_Pnt p( x[ iX ], y[ iY ], z[ iZ ] );
- vtkFloatingPointType dot = dir.XYZ() * p.XYZ();
- bndComps.insert( dot );
- }
- }
+ VISU::PIDMapper anIDMapper = myInput->GetMeshOnEntity(theMeshName,
+ CELL_ENTITY);
+ VISU::TVTKOutput* aMesh = anIDMapper->GetVTKOutput();
+
+ gInfo = & myMeshName2GridInfoMap[ theMeshName ];
+ switch(aIndexes.size()){
+ case 3:
+ {
+ gp_Dir aDir(0.0,0.0,1.0);
+ gInfo->myAxis[ 2 ] = aDir;
+ }
+ case 2:
+ {
+ gp_Dir aDir(0.0,1.0,0.0);
+ gInfo->myAxis[ 1 ] = aDir;
+ }
+ case 1:
+ {
+ gp_Dir aDir(1.0,0.0,0.0);
+ gInfo->myAxis[ 0 ] = aDir;
+ }
}
- firstValue[ iAx ] = *bndComps.begin();
- range[ iAx ] = *bndComps.rbegin() - *bndComps.begin();
- }
-
- // compute component values
- for ( iAx = 0; iAx < nbAxes; ++iAx )
- {
- list< vtkFloatingPointType > values;
- int nbVals = 0;
- set< vtkFloatingPointType >& comp = comps[ iAx ];
- set< vtkFloatingPointType >::iterator val = comp.begin();
- vtkFloatingPointType bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ];
- vtkFloatingPointType tol = 0.1 * sqrt( minSize[ iAx ]) / rng;
- for ( ; val != comp.end(); ++val ) {
- vtkFloatingPointType value = ( *val - first ) / rng;
- if ( value > bnd ) {
- values.push_back( value );
- bnd = value + tol;
- nbVals++;
- }
+
+ int nbPoints = aMesh->GetNumberOfPoints();
+ vtkFloatingPointType* coords[ 2 ];
+ if(nbPoints>1){
+ coords[0] = aMesh->GetPoints()->GetPoint(0);
+ coords[1] = aMesh->GetPoints()->GetPoint(nbPoints-1);
+ }
+
+ vector<vtkFloatingPointType> PointsCoords[3];
+ TIdTypeVector aCoordIJK;
+ switch(aIndexes.size()){
+ case 3:
+ {
+ vtkIdType nbZ = aIndexes[2];
+ aCoordIJK.clear();
+ aCoordIJK.resize(aIndexes.size(),1);
+ for(int i=0;i<nbZ;i++){
+ aCoordIJK[2]=i+1;
+ vtkIdType aObjID = anIDMapper->GetObjectIDByIndexes(aCoordIJK);
+ vtkIdType aVTKID = anIDMapper->GetNodeVTKID(aObjID);
+ vtkFloatingPointType* aPCoord = aMesh->GetPoints()->GetPoint(aVTKID);
+ PointsCoords[2].push_back(aPCoord[2]);
+ }
+ }
+ case 2:
+ {
+ vtkIdType nbJ = aIndexes[1];
+ aCoordIJK.clear();
+ aCoordIJK.resize(aIndexes.size(),1);
+ for(int i=0;i<nbJ;i++){
+ aCoordIJK[1]=i+1;
+ vtkIdType aObjID = anIDMapper->GetObjectIDByIndexes(aCoordIJK);
+ vtkIdType aVTKID = anIDMapper->GetNodeVTKID(aObjID);
+ vtkFloatingPointType* aPCoord = aMesh->GetPoints()->GetPoint(aVTKID);
+ PointsCoords[1].push_back(aPCoord[1]);
+ }
+ }
+ case 1:
+ {
+ vtkIdType nbI = aIndexes[0];
+ aCoordIJK.clear();
+ aCoordIJK.resize(aIndexes.size(),1);
+ for(int i=0;i<nbI;i++){
+ aCoordIJK[0]=i+1;
+ vtkIdType aObjID = anIDMapper->GetObjectIDByIndexes(aCoordIJK);
+ vtkIdType aVTKID = anIDMapper->GetNodeVTKID(aObjID);
+ vtkFloatingPointType* aPCoord = aMesh->GetPoints()->GetPoint(aVTKID);
+ PointsCoords[0].push_back(aPCoord[0]);
+ }
+ }
}
- // store values in gInfo
- vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ iAx ];
- myComp.resize( nbVals );
- list< vtkFloatingPointType >::iterator v = values.begin();
- for ( int i = 0; v != values.end(); ++v )
- myComp[ i++ ] = *v;
+ for(int i=0;i<aIndexes.size();i++){
+ vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ i ];
+ int aSize = PointsCoords[i].size();
+ if(aSize>0){
+ vtkFloatingPointType aLen = PointsCoords[i][aSize-1] - PointsCoords[i][0];
+ myComp.resize(aSize);
+ myComp[0] = 0;
+ for(int k=1;k<aSize;k++){
+ myComp[k]=myComp[k-1] + (PointsCoords[i][k]-PointsCoords[i][k-1])/aLen;
+ }
+ }
+ }
+
+ //ENK: 23.11.2006
}
}