-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS \r
-// \r
-// This library is free software; you can redistribute it and/or \r
-// modify it under the terms of the GNU Lesser General Public \r
-// License as published by the Free Software Foundation; either \r
-// version 2.1 of the License. \r
-// \r
-// This library is distributed in the hope that it will be useful, \r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of \r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \r
-// Lesser General Public License for more details. \r
-// \r
-// You should have received a copy of the GNU Lesser General Public \r
-// License along with this library; if not, write to the Free Software \r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA \r
-// \r
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org \r
-//\r
-//\r
-//\r
-// File : SMESH_Filter.idl\r
-// Author : Alexey Petrov, OCC\r
-\r
-#ifndef _SMESH_FILTER_IDL_\r
-#define _SMESH_FILTER_IDL_\r
-\r
-#include "SALOME_Exception.idl"\r
-#include "SALOME_GenericObj.idl"\r
-#include "SMESH_Mesh.idl"\r
-\r
-\r
-module GEOM\r
-{\r
- interface GEOM_Object;\r
-};\r
-\r
-\r
-module SMESH\r
-{\r
-\r
- /*!\r
- * Enumeration of functor types\r
- */\r
- enum FunctorType\r
- {\r
- FT_AspectRatio,\r
- FT_Warping, \r
- FT_MinimumAngle,\r
- FT_Taper, \r
- FT_Skew, \r
- FT_Area, \r
- FT_FreeBorders,\r
- FT_FreeEdges,\r
- FT_MultiConnection,\r
- FT_Length,\r
- FT_BelongToGeom,\r
- FT_BelongToPlane,\r
- FT_BelongToCylinder,\r
- FT_RangeOfIds,\r
- FT_LessThan,\r
- FT_MoreThan,\r
- FT_EqualTo,\r
- FT_LogicalNOT,\r
- FT_LogicalAND,\r
- FT_LogicalOR,\r
- FT_Undefined\r
- };\r
-\r
- /*!\r
- * Base interface for all functors ( i.e. numerical functors and predicates )\r
- */\r
- interface Functor: SALOME::GenericObj\r
- {\r
- void SetMesh( in SMESH_Mesh theMesh );\r
- FunctorType GetFunctorType();\r
- ElementType GetElementType();\r
- };\r
-\r
-\r
-\r
- /*!\r
- * Numerical functors are intended for calculating value by Id of mesh entity\r
- */\r
- interface NumericalFunctor: Functor\r
- {\r
- double GetValue( in long theElementId );\r
-\r
- /*!\r
- * Set precision for calculation. It is a position after point which is\r
- * used to functor value after calculation.\r
- */\r
- void SetPrecision( in long thePrecision );\r
- long GetPrecision();\r
- };\r
- interface MinimumAngle : NumericalFunctor{};\r
- interface AspectRatio : NumericalFunctor{};\r
- interface Warping : NumericalFunctor{};\r
- interface Taper : NumericalFunctor{};\r
- interface Skew : NumericalFunctor{};\r
- interface Area : NumericalFunctor{};\r
- interface Length : NumericalFunctor{};\r
- interface MultiConnection : NumericalFunctor{};\r
-\r
- /*!\r
- * Predicates are intended for verification of criteria,\r
- * must return bool value by mesh id\r
- */\r
- interface Predicate: Functor\r
- {\r
- boolean IsSatisfy( in long thEntityId );\r
- };\r
-\r
- /*!\r
- * Logical functor (predicate) "Belong To Geometry".\r
- * Verify whether mesh element or node belong to pointed Geom Object\r
- */\r
- interface BelongToGeom: Predicate\r
- {\r
- void SetGeom( in GEOM::GEOM_Object theGeom );\r
- void SetElementType( in ElementType theType );\r
-\r
- void SetShapeName( in string theName );\r
- string GetShapeName(); \r
- };\r
-\r
- /*!\r
- * Logical functor (predicate) "Belong To Surface".\r
- * Base interface for "belong to plane" and "belong to cylinder interfaces"\r
- */\r
- interface BelongToSurface: Predicate\r
- {\r
- void SetTolerance( in double theToler );\r
- double GetTolerance();\r
- void SetShapeName( in string theName, in ElementType theType );\r
- string GetShapeName();\r
- };\r
-\r
-\r
- /*!\r
- * Logical functor (predicate) "Belong To Plane".\r
- * Verify whether mesh element lie in pointed Geom planar object\r
- */\r
- interface BelongToPlane: BelongToSurface\r
- {\r
- void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );\r
- };\r
-\r
- /*!\r
- * Logical functor (predicate) "Belong To Culinder".\r
- * Verify whether mesh element lie in pointed Geom cylindrical object\r
- */\r
- interface BelongToCylinder: BelongToSurface\r
- {\r
- void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );\r
- };\r
-\r
- /*!\r
- * Logical functor (predicate) "Free borders".\r
- * Verify whether 1D mesh element is free ( i.e. connected to one face only )\r
- */\r
- interface FreeBorders: Predicate{};\r
-\r
- /*!\r
- * Logical functor (predicate) "Free edges".\r
- * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )\r
- */\r
- interface FreeEdges: Predicate\r
-\r
- {\r
- struct Border\r
- {\r
- long myElemId;\r
- long myPnt1, myPnt2;\r
- };\r
- typedef sequence<Border> Borders;\r
- Borders GetBorders();\r
- };\r
-\r
-\r
- /*!\r
- * Abstract logical functor (predicate) "RangeOfIds".\r
- * Verify whether an Entity Id belongs to defined sequence of id's\r
- */\r
- interface RangeOfIds: Predicate\r
- {\r
- void SetRange( in long_array theIds );\r
- boolean SetRangeStr( in string theRange );\r
- string GetRangeStr();\r
-\r
- void SetElementType( in ElementType theType );\r
- };\r
-\r
- /*!\r
- * Comparator. Predicate for compare value calculated\r
- * by numerical functor with threshold value\r
- */\r
- interface Comparator: Predicate\r
- {\r
- void SetMargin( in double theValue );\r
- void SetNumFunctor( in NumericalFunctor theFunct );\r
- double GetMargin();\r
- };\r
- interface LessThan: Comparator{};\r
- interface MoreThan: Comparator{};\r
- interface EqualTo : Comparator\r
- {\r
- void SetTolerance( in double theToler );\r
- double GetTolerance();\r
- };\r
-\r
- /*!\r
- * Logical predicates are intended for compose predicates using boolean operations\r
- */\r
- interface Logical: Predicate{};\r
-\r
- interface LogicalNOT: Logical\r
- {\r
- void SetPredicate(in Predicate thePredicate);\r
- };\r
-\r
- interface LogicalBinary: Logical\r
-{\r
- void SetPredicate1( in Predicate thePredicate );\r
- void SetPredicate2( in Predicate thePredicate );\r
- };\r
-\r
- interface LogicalAND: LogicalBinary{};\r
- interface LogicalOR : LogicalBinary{};\r
-\r
- /*!\r
- * Filter\r
- */\r
- interface Filter: SALOME::GenericObj\r
- {\r
- /*!\r
- * Structure containing information about one criterion\r
- * Type - FT_Taper, FT_Skew ...\r
- * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo\r
- * Threshold - threshold value\r
- * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined\r
- * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or\r
- * (FT_Undefined must be for the last criterion)\r
- * ThresholdStr - Threshold value defined as string. Used for:\r
- * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"\r
- * 2. BelongToGeom predicate for storing name of shape\r
- * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for\r
- * "Belong to plane" and "Belong to cylinder" predicates\r
- * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)\r
- * Precision - Precision of numerical functors\r
- */\r
- struct Criterion\r
- {\r
- long Type;\r
- long Compare;\r
- double Threshold;\r
- string ThresholdStr;\r
- long UnaryOp;\r
- long BinaryOp;\r
- double Tolerance;\r
- ElementType TypeOfElement;\r
- long Precision;\r
- };\r
-\r
- typedef sequence<Criterion> Criteria;\r
-\r
- void SetPredicate( in Predicate thePredicate );\r
- long_array GetElementsId( in SMESH_Mesh theMesh );\r
- ElementType GetElementType();\r
- Predicate GetPredicate();\r
-\r
- boolean GetCriteria( out Criteria theCriteria );\r
- boolean SetCriteria( in Criteria theCriteria );\r
- };\r
-\r
-\r
- /*!\r
- * Interface for working with library of filters\r
- */\r
- interface FilterLibrary : SALOME::GenericObj\r
- {\r
- /*!\r
- * Copy filter from library by name (new filter is created)\r
- */\r
- Filter Copy( in string theFilterName );\r
-\r
- /*!\r
- * Methods for editing library\r
- */\r
- boolean Add ( in string theFilterName, in Filter theFilter );\r
- boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter\r
- boolean Delete ( in string theFilterName );\r
- boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );\r
-\r
- /*!\r
- * Save library on disk\r
- */\r
- boolean Save();\r
- boolean SaveAs( in string aFileName );\r
-\r
- /*!\r
- * Query methods\r
- */\r
- boolean IsPresent( in string aFilterName );\r
- long NbFilters( in ElementType aType );\r
- string_array GetNames( in ElementType aType );\r
- string_array GetAllNames();\r
- void SetFileName( in string aFilterName );\r
- string GetFileName();\r
- };\r
-\r
-\r
- /*!\r
- * Interface of Filter manager\r
- */\r
- interface FilterManager: SALOME::GenericObj\r
- {\r
- /*!\r
- * Create numerical functors\r
- */\r
- MinimumAngle CreateMinimumAngle();\r
- AspectRatio CreateAspectRatio();\r
- Warping CreateWarping();\r
- Taper CreateTaper();\r
- Skew CreateSkew();\r
- Area CreateArea();\r
- Length CreateLength();\r
- MultiConnection CreateMultiConnection();\r
-\r
- /*!\r
- * Create logical functors ( predicates )\r
- */\r
- BelongToGeom CreateBelongToGeom();\r
- BelongToPlane CreateBelongToPlane();\r
- BelongToCylinder CreateBelongToCylinder();\r
-\r
- FreeBorders CreateFreeBorders();\r
- FreeEdges CreateFreeEdges();\r
-\r
- RangeOfIds CreateRangeOfIds();\r
-\r
- /*!\r
- * Create comparators ( predicates )\r
- */\r
- LessThan CreateLessThan();\r
- MoreThan CreateMoreThan();\r
- EqualTo CreateEqualTo();\r
-\r
- /*!\r
- * Create boolean operations ( predicates )\r
- */\r
- LogicalNOT CreateLogicalNOT();\r
- LogicalAND CreateLogicalAND();\r
- LogicalOR CreateLogicalOR();\r
-\r
- /*!\r
- * Create filter\r
- */\r
- Filter CreateFilter();\r
-\r
- /*!\r
- * Load filter library. If libary does not exist it is created\r
- */\r
- FilterLibrary LoadLibrary( in string aFileName );\r
-\r
- /*!\r
- * Create new library\r
- */\r
- FilterLibrary CreateLibrary();\r
-\r
- /*!\r
- * Delete library\r
- */\r
- boolean DeleteLibrary( in string aFileName );\r
- };\r
-};\r
-\r
-\r
-#endif\r
+// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : SMESH_Filter.idl
+// Author : Alexey Petrov, OCC
+
+#ifndef _SMESH_FILTER_IDL_
+#define _SMESH_FILTER_IDL_
+
+#include "SALOME_Exception.idl"
+#include "SALOME_GenericObj.idl"
+#include "SMESH_Mesh.idl"
+
+
+module GEOM
+{
+ interface GEOM_Object;
+};
+
+
+module SMESH
+{
+
+ /*!
+ * Enumeration of functor types
+ */
+ enum FunctorType
+ {
+ FT_AspectRatio,
+ FT_AspectRatio3D,
+ FT_Warping,
+ FT_MinimumAngle,
+ FT_Taper,
+ FT_Skew,
+ FT_Area,
+ FT_FreeBorders,
+ FT_FreeEdges,
+ FT_MultiConnection,
+ FT_Length,
+ FT_BelongToGeom,
+ FT_BelongToPlane,
+ FT_BelongToCylinder,
+ FT_RangeOfIds,
+ FT_LessThan,
+ FT_MoreThan,
+ FT_EqualTo,
+ FT_LogicalNOT,
+ FT_LogicalAND,
+ FT_LogicalOR,
+ FT_Undefined
+ };
+
+ /*!
+ * Base interface for all functors ( i.e. numerical functors and predicates )
+ */
+ interface Functor: SALOME::GenericObj
+ {
+ void SetMesh( in SMESH_Mesh theMesh );
+ FunctorType GetFunctorType();
+ ElementType GetElementType();
+ };
+
+
+
+ /*!
+ * Numerical functors are intended for calculating value by Id of mesh entity
+ */
+ interface NumericalFunctor: Functor
+ {
+ double GetValue( in long theElementId );
+
+ /*!
+ * Set precision for calculation. It is a position after point which is
+ * used to functor value after calculation.
+ */
+ void SetPrecision( in long thePrecision );
+ long GetPrecision();
+ };
+ interface MinimumAngle : NumericalFunctor{};
+ interface AspectRatio : NumericalFunctor{};
+ interface AspectRatio3D : NumericalFunctor{};
+ interface Warping : NumericalFunctor{};
+ interface Taper : NumericalFunctor{};
+ interface Skew : NumericalFunctor{};
+ interface Area : NumericalFunctor{};
+ interface Length : NumericalFunctor{};
+ interface MultiConnection : NumericalFunctor{};
+
+ /*!
+ * Predicates are intended for verification of criteria,
+ * must return bool value by mesh id
+ */
+ interface Predicate: Functor
+ {
+ boolean IsSatisfy( in long thEntityId );
+ };
+
+ /*!
+ * Logical functor (predicate) "Belong To Geometry".
+ * Verify whether mesh element or node belong to pointed Geom Object
+ */
+ interface BelongToGeom: Predicate
+ {
+ void SetGeom( in GEOM::GEOM_Object theGeom );
+ void SetElementType( in ElementType theType );
+
+ void SetShapeName( in string theName );
+ string GetShapeName();
+ };
+
+ /*!
+ * Logical functor (predicate) "Belong To Surface".
+ * Base interface for "belong to plane" and "belong to cylinder interfaces"
+ */
+ interface BelongToSurface: Predicate
+ {
+ void SetTolerance( in double theToler );
+ double GetTolerance();
+ void SetShapeName( in string theName, in ElementType theType );
+ string GetShapeName();
+ };
+
+
+ /*!
+ * Logical functor (predicate) "Belong To Plane".
+ * Verify whether mesh element lie in pointed Geom planar object
+ */
+ interface BelongToPlane: BelongToSurface
+ {
+ void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
+ };
+
+ /*!
+ * Logical functor (predicate) "Belong To Culinder".
+ * Verify whether mesh element lie in pointed Geom cylindrical object
+ */
+ interface BelongToCylinder: BelongToSurface
+ {
+ void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
+ };
+
+ /*!
+ * Logical functor (predicate) "Free borders".
+ * Verify whether 1D mesh element is free ( i.e. connected to one face only )
+ */
+ interface FreeBorders: Predicate{};
+
+ /*!
+ * Logical functor (predicate) "Free edges".
+ * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
+ */
+ interface FreeEdges: Predicate
+
+ {
+ struct Border
+ {
+ long myElemId;
+ long myPnt1, myPnt2;
+ };
+ typedef sequence<Border> Borders;
+ Borders GetBorders();
+ };
+
+
+ /*!
+ * Abstract logical functor (predicate) "RangeOfIds".
+ * Verify whether an Entity Id belongs to defined sequence of id's
+ */
+ interface RangeOfIds: Predicate
+ {
+ void SetRange( in long_array theIds );
+ boolean SetRangeStr( in string theRange );
+ string GetRangeStr();
+
+ void SetElementType( in ElementType theType );
+ };
+
+ /*!
+ * Comparator. Predicate for compare value calculated
+ * by numerical functor with threshold value
+ */
+ interface Comparator: Predicate
+ {
+ void SetMargin( in double theValue );
+ void SetNumFunctor( in NumericalFunctor theFunct );
+ double GetMargin();
+ };
+ interface LessThan: Comparator{};
+ interface MoreThan: Comparator{};
+ interface EqualTo : Comparator
+ {
+ void SetTolerance( in double theToler );
+ double GetTolerance();
+ };
+
+ /*!
+ * Logical predicates are intended for compose predicates using boolean operations
+ */
+ interface Logical: Predicate{};
+
+ interface LogicalNOT: Logical
+ {
+ void SetPredicate(in Predicate thePredicate);
+ };
+
+ interface LogicalBinary: Logical
+{
+ void SetPredicate1( in Predicate thePredicate );
+ void SetPredicate2( in Predicate thePredicate );
+ };
+
+ interface LogicalAND: LogicalBinary{};
+ interface LogicalOR : LogicalBinary{};
+
+ /*!
+ * Filter
+ */
+ interface Filter: SALOME::GenericObj
+ {
+ /*!
+ * Structure containing information about one criterion
+ * Type - FT_Taper, FT_Skew ...
+ * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
+ * Threshold - threshold value
+ * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
+ * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
+ * (FT_Undefined must be for the last criterion)
+ * ThresholdStr - Threshold value defined as string. Used for:
+ * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
+ * 2. BelongToGeom predicate for storing name of shape
+ * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
+ * "Belong to plane" and "Belong to cylinder" predicates
+ * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
+ * Precision - Precision of numerical functors
+ */
+ struct Criterion
+ {
+ long Type;
+ long Compare;
+ double Threshold;
+ string ThresholdStr;
+ long UnaryOp;
+ long BinaryOp;
+ double Tolerance;
+ ElementType TypeOfElement;
+ long Precision;
+ };
+
+ typedef sequence<Criterion> Criteria;
+
+ void SetPredicate( in Predicate thePredicate );
+ long_array GetElementsId( in SMESH_Mesh theMesh );
+ ElementType GetElementType();
+ Predicate GetPredicate();
+
+ boolean GetCriteria( out Criteria theCriteria );
+ boolean SetCriteria( in Criteria theCriteria );
+ };
+
+
+ /*!
+ * Interface for working with library of filters
+ */
+ interface FilterLibrary : SALOME::GenericObj
+ {
+ /*!
+ * Copy filter from library by name (new filter is created)
+ */
+ Filter Copy( in string theFilterName );
+
+ /*!
+ * Methods for editing library
+ */
+ boolean Add ( in string theFilterName, in Filter theFilter );
+ boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
+ boolean Delete ( in string theFilterName );
+ boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
+
+ /*!
+ * Save library on disk
+ */
+ boolean Save();
+ boolean SaveAs( in string aFileName );
+
+ /*!
+ * Query methods
+ */
+ boolean IsPresent( in string aFilterName );
+ long NbFilters( in ElementType aType );
+ string_array GetNames( in ElementType aType );
+ string_array GetAllNames();
+ void SetFileName( in string aFilterName );
+ string GetFileName();
+ };
+
+
+ /*!
+ * Interface of Filter manager
+ */
+ interface FilterManager: SALOME::GenericObj
+ {
+ /*!
+ * Create numerical functors
+ */
+ MinimumAngle CreateMinimumAngle();
+ AspectRatio CreateAspectRatio();
+ AspectRatio3D CreateAspectRatio3D();
+ Warping CreateWarping();
+ Taper CreateTaper();
+ Skew CreateSkew();
+ Area CreateArea();
+ Length CreateLength();
+ MultiConnection CreateMultiConnection();
+
+ /*!
+ * Create logical functors ( predicates )
+ */
+ BelongToGeom CreateBelongToGeom();
+ BelongToPlane CreateBelongToPlane();
+ BelongToCylinder CreateBelongToCylinder();
+
+ FreeBorders CreateFreeBorders();
+ FreeEdges CreateFreeEdges();
+
+ RangeOfIds CreateRangeOfIds();
+
+ /*!
+ * Create comparators ( predicates )
+ */
+ LessThan CreateLessThan();
+ MoreThan CreateMoreThan();
+ EqualTo CreateEqualTo();
+
+ /*!
+ * Create boolean operations ( predicates )
+ */
+ LogicalNOT CreateLogicalNOT();
+ LogicalAND CreateLogicalAND();
+ LogicalOR CreateLogicalOR();
+
+ /*!
+ * Create filter
+ */
+ Filter CreateFilter();
+
+ /*!
+ * Load filter library. If libary does not exist it is created
+ */
+ FilterLibrary LoadLibrary( in string aFileName );
+
+ /*!
+ * Create new library
+ */
+ FilterLibrary CreateLibrary();
+
+ /*!
+ * Delete library
+ */
+ boolean DeleteLibrary( in string aFileName );
+ };
+};
+
+
+#endif
<popup-item item-id="6011" pos-id="" label-id="Area" icon-id="mesh_area.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6012" pos-id="" label-id="Taper" icon-id="mesh_taper.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6013" pos-id="" label-id="Aspect Ratio" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="6017" pos-id="" label-id="Aspect Ratio 3D" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6014" pos-id="" label-id="Minimum angle" icon-id="mesh_angle.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6015" pos-id="" label-id="Warping" icon-id="mesh_wrap.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6016" pos-id="" label-id="Skew" icon-id="mesh_skew.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="1134" pos-id="" label-id="Clipping" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<submenu label-id="Control" item-id="2000" pos-id="">
+ <popup-item item-id="200" pos-id="" label-id="Reset" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <separator pos-id=""/>
<popup-item item-id="6001" pos-id="" label-id="Length" icon-id="mesh_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6002" pos-id="" label-id="Free Edges" icon-id="mesh_free_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6003" pos-id="" label-id="Free borders" icon-id="mesh_free_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6011" pos-id="" label-id="Area" icon-id="mesh_area.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6012" pos-id="" label-id="Taper" icon-id="mesh_taper.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6013" pos-id="" label-id="Aspect Ratio" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="6017" pos-id="" label-id="Aspect Ratio 3D" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6014" pos-id="" label-id="Minimum angle" icon-id="mesh_angle.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6015" pos-id="" label-id="Warping" icon-id="mesh_wrap.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6016" pos-id="" label-id="Skew" icon-id="mesh_skew.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
- <popup-item item-id="200" pos-id="" label-id="Reset" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <separator pos-id=""/>
<popup-item item-id="201" pos-id="" label-id="Scalar Bar Properties" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<popup-item item-id="6011" pos-id="" label-id="Area" icon-id="mesh_area.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6012" pos-id="" label-id="Taper" icon-id="mesh_taper.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6013" pos-id="" label-id="Aspect Ratio" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="6017" pos-id="" label-id="Aspect Ratio 3D" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6014" pos-id="" label-id="Minimum angle" icon-id="mesh_angle.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6015" pos-id="" label-id="Warping" icon-id="mesh_wrap.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6016" pos-id="" label-id="Skew" icon-id="mesh_skew.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6011" pos-id="" label-id="Area" icon-id="mesh_area.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6012" pos-id="" label-id="Taper" icon-id="mesh_taper.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6013" pos-id="" label-id="Aspect Ratio" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="6017" pos-id="" label-id="Aspect Ratio 3D" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6014" pos-id="" label-id="Minimum angle" icon-id="mesh_angle.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6015" pos-id="" label-id="Warping" icon-id="mesh_wrap.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6016" pos-id="" label-id="Skew" icon-id="mesh_skew.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="6011" label-id="Area" icon-id="mesh_area.png" tooltip-id="Area" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="6012" label-id="Taper" icon-id="mesh_taper.png" tooltip-id="Taper" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="6013" label-id="Aspect Ratio" icon-id="mesh_aspect.png" tooltip-id="Aspect Ratio" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="6017" label-id="Aspect Ratio 3D" icon-id="mesh_aspect.png" tooltip-id="Aspect Ratio 3D" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="6014" label-id="Minimum angle" icon-id="mesh_angle.png" tooltip-id="Minimum angle" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="6015" label-id="Warping" icon-id="mesh_wrap.png" tooltip-id="Warping angle" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="6016" label-id="Skew" icon-id="mesh_skew.png" tooltip-id="Skew" accel-id="" toggle-id="" execute-action=""/>
@COMMENCE@
-EXPORT_HEADERS = SMESH_Controls.hxx
+EXPORT_HEADERS = SMESH_Controls.hxx SMESH_ControlsDef.hxx
# Libraries targets
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-#include "SMESH_Controls.hxx"
+#include "SMESH_ControlsDef.hxx"
int main(int argc, char** argv)
{
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-#include "SMESH_Controls.hxx"
+#include "SMESH_ControlsDef.hxx"
#include <set>
#include <Geom_CylindricalSurface.hxx>
#include <Precision.hxx>
#include <TColgp_Array1OfXYZ.hxx>
-#include <TColgp_SequenceOfXYZ.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
AUXILIARY METHODS
*/
-static inline double getAngle( const gp_XYZ& P1, const gp_XYZ& P2, const gp_XYZ& P3 )
-{
- gp_Vec v1( P1 - P2 ), v2( P3 - P2 );
-
- return v1.Magnitude() < gp::Resolution() ||
- v2.Magnitude() < gp::Resolution() ? 0 : v1.Angle( v2 );
-}
-
-static inline double getArea( const gp_XYZ& P1, const gp_XYZ& P2, const gp_XYZ& P3 )
-{
- gp_Vec aVec1( P2 - P1 );
- gp_Vec aVec2( P3 - P1 );
- return ( aVec1 ^ aVec2 ).Magnitude() * 0.5;
-}
-
-static inline double getArea( const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3 )
-{
- return getArea( P1.XYZ(), P2.XYZ(), P3.XYZ() );
-}
-
-static inline double getDistance( const gp_XYZ& P1, const gp_XYZ& P2 )
-{
- double aDist = gp_Pnt( P1 ).Distance( gp_Pnt( P2 ) );
- return aDist;
-}
-
-static int getNbMultiConnection( SMDS_Mesh* theMesh, const int theId )
-{
- if ( theMesh == 0 )
- return 0;
+namespace{
+ inline double getAngle( const gp_XYZ& P1, const gp_XYZ& P2, const gp_XYZ& P3 )
+ {
+ gp_Vec v1( P1 - P2 ), v2( P3 - P2 );
+
+ return v1.Magnitude() < gp::Resolution() ||
+ v2.Magnitude() < gp::Resolution() ? 0 : v1.Angle( v2 );
+ }
- const SMDS_MeshElement* anEdge = theMesh->FindElement( theId );
- if ( anEdge == 0 || anEdge->GetType() != SMDSAbs_Edge || anEdge->NbNodes() != 2 )
- return 0;
+ inline double getArea( const gp_XYZ& P1, const gp_XYZ& P2, const gp_XYZ& P3 )
+ {
+ gp_Vec aVec1( P2 - P1 );
+ gp_Vec aVec2( P3 - P1 );
+ return ( aVec1 ^ aVec2 ).Magnitude() * 0.5;
+ }
- TColStd_MapOfInteger aMap;
+ inline double getArea( const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3 )
+ {
+ return getArea( P1.XYZ(), P2.XYZ(), P3.XYZ() );
+ }
- int aResult = 0;
- SMDS_ElemIteratorPtr anIter = anEdge->nodesIterator();
- if ( anIter != 0 )
+ inline double getDistance( const gp_XYZ& P1, const gp_XYZ& P2 )
{
- while( anIter->more() )
- {
- const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
- if ( aNode == 0 )
- return 0;
- SMDS_ElemIteratorPtr anElemIter = aNode->GetInverseElementIterator();
- while( anElemIter->more() )
- {
- const SMDS_MeshElement* anElem = anElemIter->next();
- if ( anElem != 0 && anElem->GetType() != SMDSAbs_Edge )
- {
- int anId = anElem->GetID();
+ double aDist = gp_Pnt( P1 ).Distance( gp_Pnt( P2 ) );
+ return aDist;
+ }
- if ( anIter->more() ) // i.e. first node
- aMap.Add( anId );
- else if ( aMap.Contains( anId ) )
- aResult++;
- }
+ int getNbMultiConnection( SMDS_Mesh* theMesh, const int theId )
+ {
+ if ( theMesh == 0 )
+ return 0;
+
+ const SMDS_MeshElement* anEdge = theMesh->FindElement( theId );
+ if ( anEdge == 0 || anEdge->GetType() != SMDSAbs_Edge || anEdge->NbNodes() != 2 )
+ return 0;
+
+ TColStd_MapOfInteger aMap;
+
+ int aResult = 0;
+ SMDS_ElemIteratorPtr anIter = anEdge->nodesIterator();
+ if ( anIter != 0 ) {
+ while( anIter->more() ) {
+ const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
+ if ( aNode == 0 )
+ return 0;
+ SMDS_ElemIteratorPtr anElemIter = aNode->GetInverseElementIterator();
+ while( anElemIter->more() ) {
+ const SMDS_MeshElement* anElem = anElemIter->next();
+ if ( anElem != 0 && anElem->GetType() != SMDSAbs_Edge ) {
+ int anId = anElem->GetID();
+
+ if ( anIter->more() ) // i.e. first node
+ aMap.Add( anId );
+ else if ( aMap.Contains( anId ) )
+ aResult++;
+ }
+ }
}
}
+
+ return aResult;
}
- return aResult;
-}
-
-
+}
+
using namespace SMESH::Controls;
/*
myMesh = theMesh;
}
-bool NumericalFunctor::GetPoints(const int theId,
- TColgp_SequenceOfXYZ& theRes ) const
+bool NumericalFunctor::GetPoints(const int theId,
+ TSequenceOfXYZ& theRes) const
{
- theRes.Clear();
+ theRes.clear();
if ( myMesh == 0 )
return false;
}
bool NumericalFunctor::GetPoints(const SMDS_MeshElement* anElem,
- TColgp_SequenceOfXYZ& theRes )
+ TSequenceOfXYZ& theRes)
{
- theRes.Clear();
+ theRes.clear();
if ( anElem == 0)
return false;
while( anIter->more() )
{
const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
- if ( aNode != 0 )
- theRes.Append( gp_XYZ( aNode->X(), aNode->Y(), aNode->Z() ) );
+ if ( aNode != 0 ){
+ theRes.push_back( gp_XYZ( aNode->X(), aNode->Y(), aNode->Z() ) );
+ }
}
}
double NumericalFunctor::GetValue( long theId )
{
- TColgp_SequenceOfXYZ P;
+ TSequenceOfXYZ P;
if ( GetPoints( theId, P ))
{
double aVal = GetValue( P );
double prec = pow( 10., (double)( myPrecision ) );
aVal = floor( aVal * prec + 0.5 ) / prec;
}
-
return aVal;
}
Description : Functor for calculation of minimum angle
*/
-double MinimumAngle::GetValue( const TColgp_SequenceOfXYZ& P )
+double MinimumAngle::GetValue( const TSequenceOfXYZ& P )
{
double aMin;
- if ( P.Length() == 3 )
+ if ( P.size() == 3 )
{
double A0 = getAngle( P( 3 ), P( 1 ), P( 2 ) );
double A1 = getAngle( P( 1 ), P( 2 ), P( 3 ) );
aMin = Min( A0, Min( A1, A2 ) );
}
- else if ( P.Length() == 4 )
+ else if ( P.size() == 4 )
{
double A0 = getAngle( P( 4 ), P( 1 ), P( 2 ) );
double A1 = getAngle( P( 1 ), P( 2 ), P( 3 ) );
Class : AspectRatio
Description : Functor for calculating aspect ratio
*/
-double AspectRatio::GetValue( const TColgp_SequenceOfXYZ& P )
+double AspectRatio::GetValue( const TSequenceOfXYZ& P )
{
- int nbNodes = P.Length();
+ int nbNodes = P.size();
if ( nbNodes != 3 && nbNodes != 4 )
return 0;
double aLen[ nbNodes ];
for ( int i = 0; i < nbNodes - 1; i++ )
- aLen[ i ] = getDistance( P( i + 1 ), P( i + 2 ) );
- aLen[ nbNodes - 1 ] = getDistance( P( 1 ), P( nbNodes ) );
+ aLen[ i ] = getDistance( P(i+1), P(i+2) );
+ aLen[ nbNodes - 1 ] = getDistance( P( 1 ), P(nbNodes) );
// Compute aspect ratio
Description : Functor for calculating aspect ratio
*/
-static inline double getHalfPerimeter(double theTria[3]){
- return (theTria[0] + theTria[1] + theTria[2])/2.0;
-}
+namespace{
-static inline double getArea(double theHalfPerim, double theTria[3]){
- return sqrt(theHalfPerim*
- (theHalfPerim-theTria[0])*
- (theHalfPerim-theTria[1])*
- (theHalfPerim-theTria[2]));
-}
+ inline double getHalfPerimeter(double theTria[3]){
+ return (theTria[0] + theTria[1] + theTria[2])/2.0;
+ }
-static inline double getVolume(double theLen[6]){
- double a2 = theLen[0]*theLen[0];
- double b2 = theLen[1]*theLen[1];
- double c2 = theLen[2]*theLen[2];
- double d2 = theLen[3]*theLen[3];
- double e2 = theLen[4]*theLen[4];
- double f2 = theLen[5]*theLen[5];
- double P = 4.0*a2*b2*d2;
- double Q = a2*(b2+d2-e2)-b2*(a2+d2-f2)-d2*(a2+b2-c2);
- double R = (b2+d2-e2)*(a2+d2-f2)*(a2+d2-f2);
- return sqrt(P-Q+R)/12.0;
-}
+ inline double getArea(double theHalfPerim, double theTria[3]){
+ return sqrt(theHalfPerim*
+ (theHalfPerim-theTria[0])*
+ (theHalfPerim-theTria[1])*
+ (theHalfPerim-theTria[2]));
+ }
-static inline double getHeight( const gp_Pnt& P1, const gp_Pnt& P2,
- const gp_Pnt& P3, const gp_Pnt& P4)
-{
- gp_Vec aVec1( P2.XYZ() - P1.XYZ() );
- gp_Vec aVec2( P3.XYZ() - P1.XYZ() );
- gp_Vec aNorm = aVec1 ^ aVec2;
- aNorm /= aNorm.Magnitude();
- gp_Vec aVec3( P4.XYZ() - P1.XYZ() );
- double aDist = aVec1 * aVec2;
- return fabs( aDist );
-}
+ inline double getVolume(const TSequenceOfXYZ& P){
+ gp_Vec aVec1( P( 2 ) - P( 1 ) );
+ gp_Vec aVec2( P( 3 ) - P( 1 ) );
+ gp_Vec aVec3( P( 4 ) - P( 1 ) );
+ gp_Vec anAreaVec( aVec1 ^ aVec2 );
+ return abs(aVec3 * anAreaVec) / 6.0;
+ }
+
+ inline double getMaxHeight(double theLen[6])
+ {
+ double aHeight = max(theLen[0],theLen[1]);
+ aHeight = max(aHeight,theLen[2]);
+ aHeight = max(aHeight,theLen[3]);
+ aHeight = max(aHeight,theLen[4]);
+ aHeight = max(aHeight,theLen[5]);
+ return aHeight;
+ }
-static inline double getMaxHeight( const TColgp_SequenceOfXYZ& P )
-{
- double aHeight = getHeight(P(1),P(2),P(3),P(4));
- aHeight = max(aHeight,getHeight(P(1),P(2),P(4),P(3)));
- aHeight = max(aHeight,getHeight(P(1),P(3),P(4),P(2)));
- aHeight = max(aHeight,getHeight(P(2),P(3),P(4),P(1)));
- return aHeight;
}
-double AspectRatio3D::GetValue( const TColgp_SequenceOfXYZ& P )
+double AspectRatio3D::GetValue( const TSequenceOfXYZ& P )
{
double aQuality = 0.0;
- int nbNodes = P.Length();
+ int nbNodes = P.size();
switch(nbNodes){
case 4:{
double aLen[6] = {
- getDistance(P(1),P(2)), // a
- getDistance(P(2),P(3)), // b
- getDistance(P(3),P(1)), // c
- getDistance(P(2),P(4)), // d
- getDistance(P(3),P(4)), // e
- getDistance(P(1),P(4)) // f
+ getDistance(P( 1 ),P( 2 )), // a
+ getDistance(P( 2 ),P( 3 )), // b
+ getDistance(P( 3 ),P( 1 )), // c
+ getDistance(P( 2 ),P( 4 )), // d
+ getDistance(P( 3 ),P( 4 )), // e
+ getDistance(P( 1 ),P( 4 )) // f
};
double aTria[4][3] = {
{aLen[0],aLen[1],aLen[2]}, // abc
{aLen[1],aLen[3],aLen[4]}, // bde
{aLen[2],aLen[4],aLen[5]} // cef
};
- double aHalfPerim = getHalfPerimeter(aTria[0]);
- double anArea = getArea(aHalfPerim,aTria[0]);
- aHalfPerim = getHalfPerimeter(aTria[1]);
- anArea += getArea(aHalfPerim,aTria[1]);
- aHalfPerim = getHalfPerimeter(aTria[2]);
- anArea += getArea(aHalfPerim,aTria[2]);
- double aVolume = getVolume(aLen);
- double aHeight = getMaxHeight(P);
- aQuality = 1.0/3.0*aHeight*anArea/aVolume;
+ double aSumArea = 0.0;
+ double aHalfPerimeter = getHalfPerimeter(aTria[0]);
+ double anArea = getArea(aHalfPerimeter,aTria[0]);
+ aSumArea += anArea;
+ aHalfPerimeter = getHalfPerimeter(aTria[1]);
+ anArea = getArea(aHalfPerimeter,aTria[1]);
+ aSumArea += anArea;
+ aHalfPerimeter = getHalfPerimeter(aTria[2]);
+ anArea = getArea(aHalfPerimeter,aTria[2]);
+ aSumArea += anArea;
+ aHalfPerimeter = getHalfPerimeter(aTria[3]);
+ anArea = getArea(aHalfPerimeter,aTria[3]);
+ aSumArea += anArea;
+ double aVolume = getVolume(P);
+ double aHeight = getMaxHeight(aLen);
+ static double aCoeff = sqrt(6.0)/36.0;
+ aQuality = aCoeff*aHeight*aSumArea/aVolume;
+ break;
+ }
+ case 5:{
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 2 ),P( 3 ),P( 5 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 3 ),P( 4 ),P( 5 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 2 ),P( 4 ),P( 5 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 2 ),P( 3 ),P( 4 ),P( 5 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ break;
+ }
+ case 6:{
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 2 ),P( 4 ),P( 6 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 2 ),P( 4 ),P( 3 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 2 ),P( 5 ),P( 6 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 2 ),P( 5 ),P( 3 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 2 ),P( 5 ),P( 4 ),P( 6 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 2 ),P( 5 ),P( 4 ),P( 3 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ break;
+ }
+ case 8:{
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 2 ),P( 5 ),P( 3 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 2 ),P( 5 ),P( 4 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 2 ),P( 5 ),P( 7 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 2 ),P( 5 ),P( 8 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 2 ),P( 6 ),P( 3 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 2 ),P( 6 ),P( 4 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 2 ),P( 6 ),P( 7 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 2 ),P( 6 ),P( 8 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 2 ),P( 6 ),P( 5 ),P( 3 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 2 ),P( 6 ),P( 5 ),P( 4 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 2 ),P( 6 ),P( 5 ),P( 7 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 2 ),P( 6 ),P( 5 ),P( 8 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 3 ),P( 4 ),P( 8 ),P( 1 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 3 ),P( 4 ),P( 8 ),P( 2 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 3 ),P( 4 ),P( 8 ),P( 5 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 3 ),P( 4 ),P( 8 ),P( 6 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 3 ),P( 4 ),P( 7 ),P( 1 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 3 ),P( 4 ),P( 7 ),P( 2 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 3 ),P( 4 ),P( 7 ),P( 5 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 3 ),P( 4 ),P( 7 ),P( 6 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 4 ),P( 8 ),P( 7 ),P( 1 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 4 ),P( 8 ),P( 7 ),P( 2 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 4 ),P( 8 ),P( 7 ),P( 5 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 4 ),P( 8 ),P( 7 ),P( 6 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 4 ),P( 8 ),P( 7 ),P( 2 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 4 ),P( 5 ),P( 8 ),P( 2 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 4 ),P( 5 ),P( 3 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 3 ),P( 6 ),P( 7 ),P( 1 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 2 ),P( 3 ),P( 6 ),P( 4 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 5 ),P( 6 ),P( 8 ),P( 3 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 7 ),P( 8 ),P( 6 ),P( 1 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 1 ),P( 2 ),P( 4 ),P( 7 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
+ {
+ gp_XYZ aXYZ[4] = {P( 3 ),P( 4 ),P( 2 ),P( 5 )};
+ aQuality = max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[4])),aQuality);
+ }
break;
}
}
Class : Warping
Description : Functor for calculating warping
*/
-double Warping::GetValue( const TColgp_SequenceOfXYZ& P )
+double Warping::GetValue( const TSequenceOfXYZ& P )
{
- if ( P.Length() != 4 )
+ if ( P.size() != 4 )
return 0;
gp_XYZ G = ( P( 1 ) + P( 2 ) + P( 3 ) + P( 4 ) ) / 4;
Class : Taper
Description : Functor for calculating taper
*/
-double Taper::GetValue( const TColgp_SequenceOfXYZ& P )
+double Taper::GetValue( const TSequenceOfXYZ& P )
{
- if ( P.Length() != 4 )
+ if ( P.size() != 4 )
return 0;
// Compute taper
return v1.Magnitude() < gp::Resolution() || v2.Magnitude() < gp::Resolution() ? 0 : v1.Angle( v2 );
}
-double Skew::GetValue( const TColgp_SequenceOfXYZ& P )
+double Skew::GetValue( const TSequenceOfXYZ& P )
{
- if ( P.Length() != 3 && P.Length() != 4 )
+ if ( P.size() != 3 && P.size() != 4 )
return 0;
// Compute skew
static double PI2 = PI / 2;
- if ( P.Length() == 3 )
+ if ( P.size() == 3 )
{
double A0 = fabs( PI2 - skewAngle( P( 3 ), P( 1 ), P( 2 ) ) );
double A1 = fabs( PI2 - skewAngle( P( 1 ), P( 2 ), P( 3 ) ) );
Class : Area
Description : Functor for calculating area
*/
-double Area::GetValue( const TColgp_SequenceOfXYZ& P )
+double Area::GetValue( const TSequenceOfXYZ& P )
{
- if ( P.Length() == 3 )
+ if ( P.size() == 3 )
return getArea( P( 1 ), P( 2 ), P( 3 ) );
- else if ( P.Length() == 4 )
+ else if ( P.size() == 4 )
return getArea( P( 1 ), P( 2 ), P( 3 ) ) + getArea( P( 1 ), P( 3 ), P( 4 ) );
else
return 0;
Class : Length
Description : Functor for calculating length off edge
*/
-double Length::GetValue( const TColgp_SequenceOfXYZ& P )
+double Length::GetValue( const TSequenceOfXYZ& P )
{
- return ( P.Length() == 2 ? getDistance( P( 1 ), P( 2 ) ) : 0 );
+ return ( P.size() == 2 ? getDistance( P( 1 ), P( 2 ) ) : 0 );
}
double Length::GetBadRate( double Value, int /*nbNodes*/ ) const
Class : MultiConnection
Description : Functor for calculating number of faces conneted to the edge
*/
-double MultiConnection::GetValue( const TColgp_SequenceOfXYZ& P )
+double MultiConnection::GetValue( const TSequenceOfXYZ& P )
{
return 0;
}
gp_XYZ n;
int aNbNode = theFace->NbNodes();
TColgp_Array1OfXYZ anArrOfXYZ(1,4);
- gp_XYZ p1, p2, p3, p4;
SMDS_ElemIteratorPtr aNodeItr = theFace->nodesIterator();
int i = 1;
for ( ; aNodeItr->more() && i <= 4; i++ )
anArrOfXYZ.SetValue(i, gp_XYZ( aNode->X(), aNode->Y(), aNode->Z() ) );
}
- gp_XYZ q1 = anArrOfXYZ.Value(2) - anArrOfXYZ.Value(1);
- gp_XYZ q2 = anArrOfXYZ.Value(3) - anArrOfXYZ.Value(1);
+ gp_XYZ q1 = anArrOfXYZ.Value( 2 ) - anArrOfXYZ.Value( 1 );
+ gp_XYZ q2 = anArrOfXYZ.Value( 3 ) - anArrOfXYZ.Value( 1 );
n = q1 ^ q2;
if ( aNbNode > 3 )
{
- gp_XYZ q3 = anArrOfXYZ.Value(4) - anArrOfXYZ.Value(1);
+ gp_XYZ q3 = anArrOfXYZ.Value( 4 ) - anArrOfXYZ.Value( 1 );
n += q2 ^ q3;
}
double len = n.Modulus();
#ifndef _SMESH_CONTROLS_HXX_
#define _SMESH_CONTROLS_HXX_
-#include <set>
-#include <map>
-#include <vector>
#include <boost/shared_ptr.hpp>
-#include "SMDSAbs_ElementType.hxx"
-#include "SMDS_MeshNode.hxx"
-#include <Geom_Surface.hxx>
-#include <TColStd_SequenceOfInteger.hxx>
-#include <TColStd_MapOfInteger.hxx>
-#include <TCollection_AsciiString.hxx>
-
-class SMDS_Mesh;
-class SMESHDS_Mesh;
-class SMESHDS_SubMesh;
-class gp_Pnt;
-class gp_XYZ;
-class TColgp_SequenceOfXYZ;
-class TopoDS_Shape;
-class SMDS_MeshElement;
-class SMDS_MeshFace;
-class SMDS_MeshNode;
namespace SMESH{
namespace Controls{
- class Functor
- {
- public:
- ~Functor(){}
- virtual void SetMesh( SMDS_Mesh* theMesh ) = 0;
- virtual SMDSAbs_ElementType GetType() const = 0;
- };
+
+ class Functor;
typedef boost::shared_ptr<Functor> FunctorPtr;
- class NumericalFunctor: public virtual Functor{
- public:
- NumericalFunctor();
- virtual void SetMesh( SMDS_Mesh* theMesh );
- virtual double GetValue( long theElementId );
- virtual double GetValue( const TColgp_SequenceOfXYZ& thePoints ) = 0;
- virtual SMDSAbs_ElementType GetType() const = 0;
- virtual double GetBadRate( double Value, int nbNodes ) const = 0;
- long GetPrecision() const;
- void SetPrecision( const long thePrecision );
-
- bool GetPoints (const int theId,
- TColgp_SequenceOfXYZ& theRes ) const;
- static bool GetPoints (const SMDS_MeshElement* theElem,
- TColgp_SequenceOfXYZ& theRes );
- protected:
- SMDS_Mesh* myMesh;
- long myPrecision;
- };
+
+ class NumericalFunctor;
typedef boost::shared_ptr<NumericalFunctor> NumericalFunctorPtr;
- /*
- Class : SMESH_MinimumAngle
- Description : Functor for calculation of minimum angle
- */
- class MinimumAngle: public virtual NumericalFunctor{
- public:
- virtual double GetValue( const TColgp_SequenceOfXYZ& thePoints );
- virtual double GetBadRate( double Value, int nbNodes ) const;
- virtual SMDSAbs_ElementType GetType() const;
- };
-
-
- /*
- Class : AspectRatio
- Description : Functor for calculating aspect ratio
- */
- class AspectRatio: public virtual NumericalFunctor{
- public:
- virtual double GetValue( const TColgp_SequenceOfXYZ& thePoints );
- virtual double GetBadRate( double Value, int nbNodes ) const;
- virtual SMDSAbs_ElementType GetType() const;
- };
-
-
- /*
- Class : AspectRatio3D
- Description : Functor for calculating aspect ratio of 3D elems.
- */
- class AspectRatio3D: public virtual NumericalFunctor{
- public:
- virtual double GetValue( const TColgp_SequenceOfXYZ& thePoints );
- virtual double GetBadRate( double Value, int nbNodes ) const;
- virtual SMDSAbs_ElementType GetType() const;
- };
-
-
- /*
- Class : Warping
- Description : Functor for calculating warping
- */
- class Warping: public virtual NumericalFunctor{
- public:
- virtual double GetValue( const TColgp_SequenceOfXYZ& thePoints );
- virtual double GetBadRate( double Value, int nbNodes ) const;
- virtual SMDSAbs_ElementType GetType() const;
-
- private:
- double ComputeA( const gp_XYZ&, const gp_XYZ&, const gp_XYZ&, const gp_XYZ& ) const;
- };
-
-
- /*
- Class : Taper
- Description : Functor for calculating taper
- */
- class Taper: public virtual NumericalFunctor{
- public:
- virtual double GetValue( const TColgp_SequenceOfXYZ& thePoints );
- virtual double GetBadRate( double Value, int nbNodes ) const;
- virtual SMDSAbs_ElementType GetType() const;
- };
-
-
- /*
- Class : Skew
- Description : Functor for calculating skew in degrees
- */
- class Skew: public virtual NumericalFunctor{
- public:
- virtual double GetValue( const TColgp_SequenceOfXYZ& thePoints );
- virtual double GetBadRate( double Value, int nbNodes ) const;
- virtual SMDSAbs_ElementType GetType() const;
- };
-
-
- /*
- Class : Area
- Description : Functor for calculating area
- */
- class Area: public virtual NumericalFunctor{
- public:
- virtual double GetValue( const TColgp_SequenceOfXYZ& thePoints );
- virtual double GetBadRate( double Value, int nbNodes ) const;
- virtual SMDSAbs_ElementType GetType() const;
- };
-
-
- /*
- Class : Length
- Description : Functor for calculating length of edge
- */
- class Length: public virtual NumericalFunctor{
- public:
- virtual double GetValue( const TColgp_SequenceOfXYZ& thePoints );
- virtual double GetBadRate( double Value, int nbNodes ) const;
- virtual SMDSAbs_ElementType GetType() const;
- };
-
-
- /*
- Class : MultiConnection
- Description : Functor for calculating number of faces conneted to the edge
- */
- class MultiConnection: public virtual NumericalFunctor{
- public:
- virtual double GetValue( long theElementId );
- virtual double GetValue( const TColgp_SequenceOfXYZ& thePoints );
- virtual double GetBadRate( double Value, int nbNodes ) const;
- virtual SMDSAbs_ElementType GetType() const;
- };
-
-
- /*
- PREDICATES
- */
- /*
- Class : Predicate
- Description : Base class for all predicates
- */
- class Predicate: public virtual Functor{
- public:
- virtual bool IsSatisfy( long theElementId ) = 0;
- virtual SMDSAbs_ElementType GetType() const = 0;
- };
+ class Predicate;
typedef boost::shared_ptr<Predicate> PredicatePtr;
-
-
-
- /*
- Class : FreeBorders
- Description : Predicate for free borders
- */
- class FreeBorders: public virtual Predicate{
- public:
- FreeBorders();
- virtual void SetMesh( SMDS_Mesh* theMesh );
- virtual bool IsSatisfy( long theElementId );
- virtual SMDSAbs_ElementType GetType() const;
-
- protected:
- SMDS_Mesh* myMesh;
- };
-
-
- /*
- Class : FreeEdges
- Description : Predicate for free Edges
- */
- class FreeEdges: public virtual Predicate{
- public:
- FreeEdges();
- virtual void SetMesh( SMDS_Mesh* theMesh );
- virtual bool IsSatisfy( long theElementId );
- virtual SMDSAbs_ElementType GetType() const;
- static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId );
- typedef long TElemId;
- struct Border{
- TElemId myElemId;
- TElemId myPntId[2];
- Border(long theElemId, long thePntId1, long thePntId2);
- bool operator<(const Border& x) const;
- };
- typedef std::set<Border> TBorders;
- void GetBoreders(TBorders& theBorders);
-
- protected:
- SMDS_Mesh* myMesh;
- };
- typedef boost::shared_ptr<FreeEdges> FreeEdgesPtr;
-
- /*
- Class : RangeOfIds
- Description : Predicate for Range of Ids.
- Range may be specified with two ways.
- 1. Using AddToRange method
- 2. With SetRangeStr method. Parameter of this method is a string
- like as "1,2,3,50-60,63,67,70-"
- */
- class RangeOfIds: public virtual Predicate
- {
- public:
- RangeOfIds();
- virtual void SetMesh( SMDS_Mesh* theMesh );
- virtual bool IsSatisfy( long theNodeId );
- virtual SMDSAbs_ElementType GetType() const;
- virtual void SetType( SMDSAbs_ElementType theType );
-
- bool AddToRange( long theEntityId );
- void GetRangeStr( TCollection_AsciiString& );
- bool SetRangeStr( const TCollection_AsciiString& );
-
- protected:
- SMDS_Mesh* myMesh;
-
- TColStd_SequenceOfInteger myMin;
- TColStd_SequenceOfInteger myMax;
- TColStd_MapOfInteger myIds;
-
- SMDSAbs_ElementType myType;
- };
-
- typedef boost::shared_ptr<RangeOfIds> RangeOfIdsPtr;
-
-
- /*
- Class : Comparator
- Description : Base class for comparators
- */
- class Comparator: public virtual Predicate{
- public:
- Comparator();
- virtual ~Comparator();
- virtual void SetMesh( SMDS_Mesh* theMesh );
- virtual void SetMargin(double theValue);
- virtual void SetNumFunctor(NumericalFunctorPtr theFunct);
- virtual bool IsSatisfy( long theElementId ) = 0;
- virtual SMDSAbs_ElementType GetType() const;
- double GetMargin();
-
- protected:
- double myMargin;
- NumericalFunctorPtr myFunctor;
- };
- typedef boost::shared_ptr<Comparator> ComparatorPtr;
-
-
- /*
- Class : LessThan
- Description : Comparator "<"
- */
- class LessThan: public virtual Comparator{
- public:
- virtual bool IsSatisfy( long theElementId );
- };
-
-
- /*
- Class : MoreThan
- Description : Comparator ">"
- */
- class MoreThan: public virtual Comparator{
- public:
- virtual bool IsSatisfy( long theElementId );
- };
-
-
- /*
- Class : EqualTo
- Description : Comparator "="
- */
- class EqualTo: public virtual Comparator{
- public:
- EqualTo();
- virtual bool IsSatisfy( long theElementId );
- virtual void SetTolerance( double theTol );
- virtual double GetTolerance();
-
- private:
- double myToler;
- };
- typedef boost::shared_ptr<EqualTo> EqualToPtr;
-
-
- /*
- Class : LogicalNOT
- Description : Logical NOT predicate
- */
- class LogicalNOT: public virtual Predicate{
- public:
- LogicalNOT();
- virtual ~LogicalNOT();
- virtual bool IsSatisfy( long theElementId );
- virtual void SetMesh( SMDS_Mesh* theMesh );
- virtual void SetPredicate(PredicatePtr thePred);
- virtual SMDSAbs_ElementType GetType() const;
-
- private:
- PredicatePtr myPredicate;
- };
- typedef boost::shared_ptr<LogicalNOT> LogicalNOTPtr;
-
-
- /*
- Class : LogicalBinary
- Description : Base class for binary logical predicate
- */
- class LogicalBinary: public virtual Predicate{
- public:
- LogicalBinary();
- virtual ~LogicalBinary();
- virtual void SetMesh( SMDS_Mesh* theMesh );
- virtual void SetPredicate1(PredicatePtr thePred);
- virtual void SetPredicate2(PredicatePtr thePred);
- virtual SMDSAbs_ElementType GetType() const;
-
- protected:
- PredicatePtr myPredicate1;
- PredicatePtr myPredicate2;
- };
- typedef boost::shared_ptr<LogicalBinary> LogicalBinaryPtr;
-
-
- /*
- Class : LogicalAND
- Description : Logical AND
- */
- class LogicalAND: public virtual LogicalBinary{
- public:
- virtual bool IsSatisfy( long theElementId );
- };
-
-
- /*
- Class : LogicalOR
- Description : Logical OR
- */
- class LogicalOR: public virtual LogicalBinary{
- public:
- virtual bool IsSatisfy( long theElementId );
- };
-
-
- /*
- Class : ManifoldPart
- Description : Predicate for manifold part of mesh
- */
- class ManifoldPart: public virtual Predicate{
- public:
-
- /* internal class for algorithm uses */
- class Link
- {
- public:
- Link( SMDS_MeshNode* theNode1,
- SMDS_MeshNode* theNode2 );
- ~Link();
-
- bool IsEqual( const ManifoldPart::Link& theLink ) const;
- bool operator<(const ManifoldPart::Link& x) const;
-
- SMDS_MeshNode* myNode1;
- SMDS_MeshNode* myNode2;
- };
-
- bool IsEqual( const ManifoldPart::Link& theLink1,
- const ManifoldPart::Link& theLink2 );
-
- typedef std::set<ManifoldPart::Link> TMapOfLink;
- typedef std::vector<SMDS_MeshFace*> TVectorOfFacePtr;
- typedef std::vector<ManifoldPart::Link> TVectorOfLink;
- typedef std::map<SMDS_MeshFace*,int> TDataMapFacePtrInt;
- typedef std::map<ManifoldPart::Link,SMDS_MeshFace*> TDataMapOfLinkFacePtr;
-
- ManifoldPart();
- ~ManifoldPart();
- virtual void SetMesh( SMDS_Mesh* theMesh );
- // inoke when all parameters already set
- virtual bool IsSatisfy( long theElementId );
- virtual SMDSAbs_ElementType GetType() const;
-
- void SetAngleTolerance( const double theAngToler );
- double GetAngleTolerance() const;
- void SetIsOnlyManifold( const bool theIsOnly );
- void SetStartElem( const long theStartElemId );
-
- private:
- bool process();
- bool findConnected( const TDataMapFacePtrInt& theAllFacePtrInt,
- SMDS_MeshFace* theStartFace,
- TMapOfLink& theNonManifold,
- TColStd_MapOfInteger& theResFaces );
- bool isInPlane( const SMDS_MeshFace* theFace1,
- const SMDS_MeshFace* theFace2 );
- void expandBoundary( TMapOfLink& theMapOfBoundary,
- TVectorOfLink& theSeqOfBoundary,
- TDataMapOfLinkFacePtr& theDMapLinkFacePtr,
- TMapOfLink& theNonManifold,
- SMDS_MeshFace* theNextFace ) const;
-
- void getFacesByLink( const Link& theLink,
- TVectorOfFacePtr& theFaces ) const;
-
- private:
- SMDS_Mesh* myMesh;
- TColStd_MapOfInteger myMapIds;
- TColStd_MapOfInteger myMapBadGeomIds;
- TVectorOfFacePtr myAllFacePtr;
- TDataMapFacePtrInt myAllFacePtrIntDMap;
- double myAngToler;
- bool myIsOnlyManifold;
- long myStartElemId;
-
- };
- typedef boost::shared_ptr<ManifoldPart> ManifoldPartPtr;
-
-
- /*
- Class : ElementsOnSurface
- Description : Predicate elements that lying on indicated surface
- (plane or cylinder)
- */
- class ElementsOnSurface : public virtual Predicate {
- public:
- ElementsOnSurface();
- ~ElementsOnSurface();
- virtual void SetMesh( SMDS_Mesh* theMesh );
- virtual bool IsSatisfy( long theElementId );
- virtual SMDSAbs_ElementType GetType() const;
-
- void SetTolerance( const double theToler );
- double GetTolerance() const;
- void SetSurface( const TopoDS_Shape& theShape,
- const SMDSAbs_ElementType theType );
-
- private:
- void process();
- void process( const SMDS_MeshElement* theElem );
- bool isOnSurface( const SMDS_MeshNode* theNode ) const;
-
- private:
- SMDS_Mesh* myMesh;
- TColStd_MapOfInteger myIds;
- SMDSAbs_ElementType myType;
- Handle(Geom_Surface) mySurf;
- double myToler;
- };
-
- typedef boost::shared_ptr<ElementsOnSurface> ElementsOnSurfacePtr;
-
-
- /*
- FILTER
- */
- class Filter{
- public:
- Filter();
- virtual ~Filter();
- virtual void SetPredicate(PredicatePtr thePred);
- typedef std::vector<long> TIdSequence;
- virtual TIdSequence GetElementsId( SMDS_Mesh* theMesh );
-
- protected:
- PredicatePtr myPredicate;
- };
- };
-};
+ }
+}
#endif
#include "SMESH_Actor.h"
#include "SMESH_ActorUtils.h"
#include "SMESH_DeviceActor.h"
+#include "SMESH_ControlsDef.hxx"
#include "SALOME_ExtractUnstructuredGrid.h"
#include "QAD_Config.h"
-#include "utilities.h"
#include <qstringlist.h>
#include <vtkTimeStamp.h>
#include <vtkPlane.h>
#include <vtkImplicitBoolean.h>
+#include "utilities.h"
+
#ifdef _DEBUG_
static int MYDEBUG = 0;
-static int MYDEBUGWITHFILES = 0;
#else
static int MYDEBUG = 0;
-static int MYDEBUGWITHFILES = 0;
#endif
static int aLineWidthInc = 2;
myControlActor = my2DActor;
break;
}
+ case eAspectRatio3D:
+ {
+ SMESH::Controls::AspectRatio3D* aControl = new SMESH::Controls::AspectRatio3D();
+ aControl->SetPrecision( myControlsPrecision );
+ aFunctor.reset( aControl );
+ myControlActor = my3DActor;
+ break;
+ }
case eMinimumAngle:
{
SMESH::Controls::MinimumAngle* aControl = new SMESH::Controls::MinimumAngle();
bool GetCellsLabeled(){ return myIsCellsLabeled;}
enum eControl{eNone, eLengthEdges, eFreeBorders, eFreeEdges, eMultiConnection,
- eArea, eTaper, eAspectRatio, eMinimumAngle, eWarping, eSkew};
+ eArea, eTaper, eAspectRatio, eMinimumAngle, eWarping, eSkew,
+ eAspectRatio3D};
void SetControlMode(eControl theMode);
eControl GetControlMode(){ return myColorMode;}
#include "SMESH_DeviceActor.h"
#include "SMESH_ExtractGeometry.h"
+#include "SMESH_ControlsDef.hxx"
#include "SALOME_Transform.h"
#include "SALOME_TransformFilter.h"
#include "SALOME_PassThroughFilter.h"
#include "SALOME_ExtractUnstructuredGrid.h"
-#include "utilities.h"
-
// VTK Includes
#include <vtkObjectFactory.h>
#include <vtkShrinkFilter.h>
#include <vtkImplicitBoolean.h>
+#include "utilities.h"
+
#ifdef _DEBUG_
static int MYDEBUG = 0;
-static int MYDEBUGWITHFILES = 0;
#else
static int MYDEBUG = 0;
-static int MYDEBUGWITHFILES = 0;
#endif
using namespace std;
anIdList->SetNumberOfIds(2);
FreeEdges::TBorders::const_iterator anIter = aBorders.begin();
- for(vtkIdType aVtkId; anIter != aBorders.end(); anIter++){
+ for(; anIter != aBorders.end(); anIter++){
const FreeEdges::Border& aBorder = *anIter;
int aNode[2] = {
myVisualObj->GetNodeVTKId(aBorder.myPntId[0]),
#include "SMESH_Object.h"
#include "SMDS_Mesh.hxx"
-#include "SALOME_ExtractUnstructuredGrid.h"
#include "SMESH_Actor.h"
+#include "SMESH_ControlsDef.hxx"
+#include "SALOME_ExtractUnstructuredGrid.h"
#include CORBA_SERVER_HEADER(SALOME_Exception)
SMESH::log_array_var& theSeq,
CORBA::Long theId)
{
- const SMESH::double_array& aCoords = theSeq[theId].coords;
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
if(3*aNbElems != anIndexes.length())
SMESH::log_array_var& theSeq,
CORBA::Long theId)
{
- const SMESH::double_array& aCoords = theSeq[theId].coords;
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
if(4*aNbElems != anIndexes.length())
SMESH::log_array_var theSeq,
CORBA::Long theId)
{
- const SMESH::double_array& aCoords = theSeq[theId].coords;
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
if(5*aNbElems != anIndexes.length())
SMESH::log_array_var& theSeq,
CORBA::Long theId)
{
- const SMESH::double_array& aCoords = theSeq[theId].coords;
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
if(5*aNbElems != anIndexes.length())
SMESH::log_array_var& theSeq,
CORBA::Long theId)
{
- const SMESH::double_array& aCoords = theSeq[theId].coords;
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
if(6*aNbElems != anIndexes.length())
SMESH::log_array_var& theSeq,
CORBA::Long theId)
{
- const SMESH::double_array& aCoords = theSeq[theId].coords;
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
if(7*aNbElems != anIndexes.length())
SMESH::log_array_var& theSeq,
CORBA::Long theId)
{
- const SMESH::double_array& aCoords = theSeq[theId].coords;
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
if(9*aNbElems != anIndexes.length())
{
vtkPoints* aPoints = vtkPoints::New();
createPoints( aPoints );
- int nbPoints = aPoints->GetNumberOfPoints();
myGrid->SetPoints( aPoints );
aPoints->Delete();
// Create cells
/*
+ int nbPoints = aPoints->GetNumberOfPoints();
vtkIdList *anIdList = vtkIdList::New();
anIdList->SetNumberOfIds( 1 );
const SMESH::double_array& aCoords = aSeq[anId].coords;
const SMESH::long_array& anIndexes = aSeq[anId].indexes;
CORBA::Long anElemId = 0, aNbElems = aSeq[anId].number;
- SMDS_MeshElement* anElem = NULL;
CORBA::Long aCommand = aSeq[anId].commandType;
switch(aCommand)
#include "SMESH_MeshEditor.hxx"
+#include "SMESH_ControlsDef.hxx"
+
#include "SMDS_FaceOfNodes.hxx"
#include "SMDS_VolumeTool.hxx"
#include "SMESHDS_Group.hxx"
#include "SMESHDS_Mesh.hxx"
#include "SMESH_subMesh.hxx"
-#include "utilities.h"
-
-#include <TColgp_SequenceOfXYZ.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <gp_Vec.hxx>
#include <map>
+#include "utilities.h"
+
using namespace std;
+using namespace SMESH::Controls;
typedef map<const SMDS_MeshNode*, const SMDS_MeshNode*> TNodeNodeMap;
typedef map<const SMDS_MeshNode*, list<const SMDS_MeshNode*> > TNodeOfNodeListMap;
static double getBadRate (const SMDS_MeshElement* theElem,
SMESH::Controls::NumericalFunctorPtr& theCrit)
{
- TColgp_SequenceOfXYZ P;
+ TSequenceOfXYZ P;
if ( !theElem || !theCrit->GetPoints( theElem, P ))
return 1e100;
return theCrit->GetBadRate( theCrit->GetValue( P ), theElem->NbNodes() );
double angle = 2*PI; // bad angle
// get normals
- TColgp_SequenceOfXYZ P1, P2;
+ TSequenceOfXYZ P1, P2;
if ( !SMESH::Controls::NumericalFunctor::GetPoints( tr1, P1 ) ||
!SMESH::Controls::NumericalFunctor::GetPoints( tr2, P2 ))
return angle;
nbElems++;
gp_XYZ elemCenter(0.,0.,0.);
- TColgp_SequenceOfXYZ aNodePoints;
+ TSequenceOfXYZ aNodePoints;
SMDS_ElemIteratorPtr itN = elem->nodesIterator();
while ( itN->more() )
{
const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>( itN->next() );
gp_XYZ aP( aNode->X(), aNode->Y(), aNode->Z() );
- aNodePoints.Append( aP );
+ aNodePoints.push_back( aP );
elemCenter += aP;
}
double elemArea = anAreaFunc.GetValue( aNodePoints );
const SMDS_MeshElement* elem = (*itElem);
if ( !elem || elem->GetType() != SMDSAbs_Face )
continue;
- TColgp_SequenceOfXYZ aPoints;
+ TSequenceOfXYZ aPoints;
if ( aQualityFunc.GetPoints( elem, aPoints )) {
double aValue = aQualityFunc.GetValue( aPoints );
if ( aValue > maxRatio )
switch(theCommandID){
case 1134:{
SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
- SMESHGUI_ClippingDlg *aDlg =
- new SMESHGUI_ClippingDlg(QAD_Application::getDesktop(),"",false);
+ new SMESHGUI_ClippingDlg(QAD_Application::getDesktop(),"",false);
return;
}
case 1133:{
SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
- SMESHGUI_TransparencyDlg *aDlg =
- new SMESHGUI_TransparencyDlg(QAD_Application::getDesktop(),"",false);
+ new SMESHGUI_TransparencyDlg(QAD_Application::getDesktop(),"",false);
return;
}}
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
aTitle = QObject::tr( "ASPECTRATIO_ELEMENTS" );
aControl = SMESH_Actor::eAspectRatio;
break;
+ case 6017:
+ aTitle = QObject::tr( "ASPECTRATIO_3D_ELEMENTS" );
+ aControl = SMESH_Actor::eAspectRatio3D;
+ break;
case 6014:
aTitle = QObject::tr( "MINIMUMANGLE_ELEMENTS" );
aControl = SMESH_Actor::eMinimumAngle;
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_NodesDlg *aDlg = new SMESHGUI_NodesDlg(parent, "", Sel);
+ new SMESHGUI_NodesDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if ( myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK )
{
EmitSignalDeactivateDialog();
- SMESHGUI_FilterDlg *aDlg = new SMESHGUI_FilterDlg( parent, SMESH::EDGE );
+ new SMESHGUI_FilterDlg( parent, SMESH::EDGE );
}
break;
}
if(checkLock(aStudy)) break;
SALOME_Selection *Sel = SALOME_Selection::Selection( myActiveStudy->getSelection() );
- SMESHGUI_MoveNodesDlg *aDlg = new SMESHGUI_MoveNodesDlg( parent, Sel );
+ new SMESHGUI_MoveNodesDlg( parent, Sel );
break;
}
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_AddSubMeshDlg *aDlg = new SMESHGUI_AddSubMeshDlg(parent, "", Sel);
+ new SMESHGUI_AddSubMeshDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if(checkLock(aStudy)) break;
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_InitMeshDlg *aDlg = new SMESHGUI_InitMeshDlg(parent, "", Sel);
+ new SMESHGUI_InitMeshDlg(parent, "", Sel);
break;
}
if(checkLock(aStudy)) break;
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_EditHypothesesDlg *aDlg = new SMESHGUI_EditHypothesesDlg(parent, "", Sel);
+ new SMESHGUI_EditHypothesesDlg(parent, "", Sel);
break;
}
if(checkLock(aStudy)) break;
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_EditHypothesesDlg *aDlg = new SMESHGUI_EditHypothesesDlg(parent, "", Sel);
+ new SMESHGUI_EditHypothesesDlg(parent, "", Sel);
break;
}
if(checkLock(aStudy)) break;
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_EditHypothesesDlg *aDlg = new SMESHGUI_EditHypothesesDlg(parent, "", Sel);
+ new SMESHGUI_EditHypothesesDlg(parent, "", Sel);
break;
}
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_SmoothingDlg *aDlg = new SMESHGUI_SmoothingDlg(parent, "", Sel);
+ new SMESHGUI_SmoothingDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_ExtrusionDlg *aDlg = new SMESHGUI_ExtrusionDlg(parent, "", Sel);
+ new SMESHGUI_ExtrusionDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_RevolutionDlg *aDlg = new SMESHGUI_RevolutionDlg(parent, "", Sel);
+ new SMESHGUI_RevolutionDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
for ( ; It.More(); It.Next() ) {
Sel->ClearIObjects();
Sel->AddIObject( It.Value() );
- SMESHGUI_MeshInfosDlg *aDlg = new SMESHGUI_MeshInfosDlg(parent, "", false);
+ new SMESHGUI_MeshInfosDlg(parent, "", false);
}
// restore selection
Sel->ClearIObjects();
Sel->AddIObject( It.Value() );
}
else
- SMESHGUI_MeshInfosDlg *aDlg = new SMESHGUI_MeshInfosDlg(parent, "", false);
+ new SMESHGUI_MeshInfosDlg(parent, "", false);
break;
}
for ( ; It.More(); It.Next() ) {
Sel->ClearIObjects();
Sel->AddIObject( It.Value() );
- SMESHGUI_StandardMeshInfosDlg *aDlg = new SMESHGUI_StandardMeshInfosDlg(parent, "", false);
+ new SMESHGUI_StandardMeshInfosDlg(parent, "", false);
}
// restore selection
Sel->ClearIObjects();
Sel->AddIObject( It.Value() );
}
else
- SMESHGUI_StandardMeshInfosDlg *aDlg = new SMESHGUI_StandardMeshInfosDlg(parent, "", false);
+ new SMESHGUI_StandardMeshInfosDlg(parent, "", false);
break;
}
type = SMDSAbs_Volume; nbNodes = 8; break;
default:;
}
- SMESHGUI_AddMeshElementDlg *aDlg =
- new SMESHGUI_AddMeshElementDlg(parent, "", Sel, type, nbNodes);
+ new SMESHGUI_AddMeshElementDlg(parent, "", Sel, type, nbNodes);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_RemoveNodesDlg *aDlg = new SMESHGUI_RemoveNodesDlg(parent, "", Sel);
+ new SMESHGUI_RemoveNodesDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_RemoveElementsDlg *aDlg = new SMESHGUI_RemoveElementsDlg(parent, "", Sel);
+ new SMESHGUI_RemoveElementsDlg(parent, "", Sel);
}
else
{
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_RenumberingDlg *aDlg = new SMESHGUI_RenumberingDlg(parent, "", Sel, 0);
+ new SMESHGUI_RenumberingDlg(parent, "", Sel, 0);
}
else
{
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_RenumberingDlg *aDlg = new SMESHGUI_RenumberingDlg(parent, "", Sel, 1);
+ new SMESHGUI_RenumberingDlg(parent, "", Sel, 1);
}
else
{
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_TranslationDlg *aDlg = new SMESHGUI_TranslationDlg(parent, "", Sel);
+ new SMESHGUI_TranslationDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_RotationDlg *aDlg = new SMESHGUI_RotationDlg(parent, "", Sel);
+ new SMESHGUI_RotationDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_SymmetryDlg *aDlg = new SMESHGUI_SymmetryDlg(parent, "", Sel);
+ new SMESHGUI_SymmetryDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_SewingDlg *aDlg = new SMESHGUI_SewingDlg(parent, "", Sel);
+ new SMESHGUI_SewingDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_MergeNodesDlg *aDlg = new SMESHGUI_MergeNodesDlg(parent, "", Sel);
+ new SMESHGUI_MergeNodesDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
{
if(checkLock(aStudy)) break;
EmitSignalDeactivateDialog();
- SMESHGUI_CreateHypothesesDlg *aDlg =
- new SMESHGUI_CreateHypothesesDlg (parent, "", FALSE, false);
+ new SMESHGUI_CreateHypothesesDlg (parent, "", FALSE, false);
break;
}
case 5010: // ALGO
{
if(checkLock(aStudy)) break;
EmitSignalDeactivateDialog();
- SMESHGUI_CreateHypothesesDlg *aDlg =
- new SMESHGUI_CreateHypothesesDlg (parent, "", FALSE, true);
+ new SMESHGUI_CreateHypothesesDlg (parent, "", FALSE, true);
break;
}
}
break;
- case 6016: // CONTROLS
+ case 6017: // CONTROLS
+ case 6016:
case 6015:
case 6014:
case 6013:
if ( mi && mi->popup() ) {
int prType = ac->GetRepresentation();
// Display Mode / Wireframe
- if(!aNbFaces && !aNbVolumes && !aNbEdges){
+ if(aNbVolumes == 0 && aNbFaces == 0 && aNbEdges == 0){
mi->popup()->removeItem( 211 );
}else{
mi->popup()->setItemChecked( 211, prType == SMESH_Actor::eEdge );
}
// Display Mode / Shading
- if(!aNbFaces && !aNbVolumes){
+ if(aNbFaces == 0 && aNbVolumes == 0){
mi->popup()->removeItem( 212 );
}else{
mi->popup()->setItemChecked( 212, prType == SMESH_Actor::eSurface );
mi->popup()->setItemChecked( 6012, true ); break;
case SMESH_Actor::eAspectRatio:
mi->popup()->setItemChecked( 6013, true ); break;
+ case SMESH_Actor::eAspectRatio3D:
+ mi->popup()->setItemChecked( 6017, true ); break;
case SMESH_Actor::eMinimumAngle:
mi->popup()->setItemChecked( 6014, true ); break;
case SMESH_Actor::eWarping:
break;
}
TVisualObjPtr aVisualObj = ac->GetObject();
- if(!aNbEdges){
+ if(aNbEdges == 0){
mi->popup()->removeItem( 6001 );
mi->popup()->removeItem( 6003 );
mi->popup()->removeItem( 6004 );
}
- if(!aNbFaces){
+ if(aNbFaces == 0){
mi->popup()->removeItem( 6002 );
mi->popup()->removeItem( 6011 );
mi->popup()->removeItem( 6012 );
mi->popup()->removeItem( 6015 );
mi->popup()->removeItem( 6016 );
}
- if(!aNbFaces && !aNbEdges)
+ if(aNbVolumes == 0){
+ mi->popup()->removeItem( 6017 );
+ }
+ if(aNbFaces == 0 && aNbEdges == 0 && aNbVolumes == 0)
popup->removeItem( 2000 ); // Scalar Bar
}
}
msgid "ASPECTRATIO_ELEMENTS"
msgstr "Aspect Ratio"
+msgid "ASPECTRATIO_3D_ELEMENTS"
+msgstr "Aspect Ratio 3D"
+
msgid "MINIMUMANGLE_ELEMENTS"
msgstr "Minimum Angle"
}
+/*
+ Class : AspectRatio3D
+ Description : Functor for calculating aspect ratio 3D
+*/
+AspectRatio3D_i::AspectRatio3D_i()
+{
+ myNumericalFunctorPtr.reset( new Controls::AspectRatio3D() );
+ myFunctorPtr = myNumericalFunctorPtr;
+}
+
+FunctorType AspectRatio3D_i::GetFunctorType()
+{
+ return SMESH::FT_AspectRatio3D;
+}
+
+
/*
Class : Warping_i
Description : Functor for calculating warping
}
+AspectRatio3D_ptr FilterManager_i::CreateAspectRatio3D()
+{
+ SMESH::AspectRatio3D_i* aServant = new SMESH::AspectRatio3D_i();
+ SMESH::AspectRatio3D_var anObj = aServant->_this();
+ return anObj._retn();
+}
+
+
Warping_ptr FilterManager_i::CreateWarping()
{
SMESH::Warping_i* aServant = new SMESH::Warping_i();
case SMESH::FT_AspectRatio:
aFunctor = aFilterMgr->CreateAspectRatio();
break;
+ case SMESH::FT_AspectRatio3D:
+ aFunctor = aFilterMgr->CreateAspectRatio3D();
+ break;
case SMESH::FT_Warping:
aFunctor = aFilterMgr->CreateWarping();
break;
#include <TopoDS_Shape.hxx>
#include "SALOME_GenericObj_i.hh"
-#include "SMESH_Controls.hxx"
+#include "SMESH_ControlsDef.hxx"
class SMESHDS_Mesh;
};
+/*
+ Class : AspectRatio3D_i
+ Description : Functor for calculating aspect ratio for 3D
+*/
+class AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
+ public virtual NumericalFunctor_i
+{
+public:
+ AspectRatio3D_i();
+ FunctorType GetFunctorType();
+};
+
+
/*
Class : Warping_i
Description : Functor for calculating warping
FilterManager_i();
MinimumAngle_ptr CreateMinimumAngle();
AspectRatio_ptr CreateAspectRatio();
+ AspectRatio3D_ptr CreateAspectRatio3D();
Warping_ptr CreateWarping();
Taper_ptr CreateTaper();
Skew_ptr CreateSkew();
#include "OpUtil.hxx"
#include "TCollection_AsciiString.hxx"
-#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
-#include <TColStd_SequenceOfInteger.hxx>
#include "SMESHDS_Command.hxx"
#include "SMESHDS_CommandType.hxx"
#include "SMESH_MeshEditor_i.hxx"
#include "SMESH_Gen_i.hxx"
#include "DriverMED_R_SMESHDS_Mesh.h"
+#include <TColStd_MapOfInteger.hxx>
+#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <TColStd_SequenceOfInteger.hxx>
+
#include <string>
#include <iostream>
-// _CS_gbo_050504 Ajout explicite du sstream pour ostringstream
#include <sstream>
#ifdef _DEBUG_