From: apo Date: Thu, 23 Dec 2004 10:31:25 +0000 (+0000) Subject: Fix on - Bug PAL7220: DEVELOPMENT : 3D Aspect Ratio X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=07085534b5a1fab92a228928420f3da9223e51a6;p=modules%2Fsmesh.git Fix on - Bug PAL7220: DEVELOPMENT : 3D Aspect Ratio --- diff --git a/idl/SMESH_Filter.idl b/idl/SMESH_Filter.idl index d1f0c3d9f..1ff3a3a6b 100644 --- a/idl/SMESH_Filter.idl +++ b/idl/SMESH_Filter.idl @@ -1,379 +1,382 @@ -// 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_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 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 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 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(); - 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 +// 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 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 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 diff --git a/resources/SMESH_en.xml b/resources/SMESH_en.xml index b574a7f2f..a2e023228 100644 --- a/resources/SMESH_en.xml +++ b/resources/SMESH_en.xml @@ -80,6 +80,7 @@ + @@ -235,6 +236,8 @@ + + @@ -242,12 +245,11 @@ + - - @@ -284,6 +286,7 @@ + @@ -328,6 +331,7 @@ + @@ -376,6 +380,7 @@ + diff --git a/src/Controls/Makefile.in b/src/Controls/Makefile.in index 556958d66..2a862b834 100644 --- a/src/Controls/Makefile.in +++ b/src/Controls/Makefile.in @@ -31,7 +31,7 @@ VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl @COMMENCE@ -EXPORT_HEADERS = SMESH_Controls.hxx +EXPORT_HEADERS = SMESH_Controls.hxx SMESH_ControlsDef.hxx # Libraries targets diff --git a/src/Controls/SMESHControls.cxx b/src/Controls/SMESHControls.cxx index 10ecd711a..0490f9ff1 100644 --- a/src/Controls/SMESHControls.cxx +++ b/src/Controls/SMESHControls.cxx @@ -17,7 +17,7 @@ // // 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) { diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index a0dd64e13..7d7a6909a 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -17,7 +17,7 @@ // // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -#include "SMESH_Controls.hxx" +#include "SMESH_ControlsDef.hxx" #include @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -53,73 +52,71 @@ 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; /* @@ -141,10 +138,10 @@ void NumericalFunctor::SetMesh( SMDS_Mesh* theMesh ) 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; @@ -153,9 +150,9 @@ bool NumericalFunctor::GetPoints(const int theId, } bool NumericalFunctor::GetPoints(const SMDS_MeshElement* anElem, - TColgp_SequenceOfXYZ& theRes ) + TSequenceOfXYZ& theRes) { - theRes.Clear(); + theRes.clear(); if ( anElem == 0) return false; @@ -167,8 +164,9 @@ bool NumericalFunctor::GetPoints(const SMDS_MeshElement* anElem, 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() ) ); + } } } @@ -187,7 +185,7 @@ void NumericalFunctor::SetPrecision( const long thePrecision ) double NumericalFunctor::GetValue( long theId ) { - TColgp_SequenceOfXYZ P; + TSequenceOfXYZ P; if ( GetPoints( theId, P )) { double aVal = GetValue( P ); @@ -196,7 +194,6 @@ double NumericalFunctor::GetValue( long theId ) double prec = pow( 10., (double)( myPrecision ) ); aVal = floor( aVal * prec + 0.5 ) / prec; } - return aVal; } @@ -208,11 +205,11 @@ double NumericalFunctor::GetValue( long theId ) 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 ) ); @@ -220,7 +217,7 @@ double MinimumAngle::GetValue( const TColgp_SequenceOfXYZ& P ) 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 ) ); @@ -251,9 +248,9 @@ SMDSAbs_ElementType MinimumAngle::GetType() const 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; @@ -262,8 +259,8 @@ double AspectRatio::GetValue( const TColgp_SequenceOfXYZ& P ) 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 @@ -307,64 +304,52 @@ SMDSAbs_ElementType AspectRatio::GetType() const 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 @@ -372,15 +357,204 @@ double AspectRatio3D::GetValue( const TColgp_SequenceOfXYZ& P ) {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; } } @@ -405,9 +579,9 @@ SMDSAbs_ElementType AspectRatio3D::GetType() const 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; @@ -462,9 +636,9 @@ SMDSAbs_ElementType Warping::GetType() const 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 @@ -514,14 +688,14 @@ static inline double skewAngle( const gp_XYZ& p1, const gp_XYZ& p2, const gp_XYZ 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 ) ) ); @@ -562,11 +736,11 @@ SMDSAbs_ElementType Skew::GetType() const 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; @@ -587,9 +761,9 @@ SMDSAbs_ElementType Area::GetType() const 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 @@ -607,7 +781,7 @@ SMDSAbs_ElementType Length::GetType() 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; } @@ -1426,7 +1600,6 @@ static gp_XYZ getNormale( const SMDS_MeshFace* theFace ) 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++ ) @@ -1435,12 +1608,12 @@ static gp_XYZ getNormale( const SMDS_MeshFace* theFace ) 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(); diff --git a/src/Controls/SMESH_Controls.hxx b/src/Controls/SMESH_Controls.hxx index 491e59b66..fa4558db5 100644 --- a/src/Controls/SMESH_Controls.hxx +++ b/src/Controls/SMESH_Controls.hxx @@ -20,508 +20,24 @@ #ifndef _SMESH_CONTROLS_HXX_ #define _SMESH_CONTROLS_HXX_ -#include -#include -#include #include -#include "SMDSAbs_ElementType.hxx" -#include "SMDS_MeshNode.hxx" -#include -#include -#include -#include - -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 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 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 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 TBorders; - void GetBoreders(TBorders& theBorders); - - protected: - SMDS_Mesh* myMesh; - }; - typedef boost::shared_ptr 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 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 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 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 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 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 TMapOfLink; - typedef std::vector TVectorOfFacePtr; - typedef std::vector TVectorOfLink; - typedef std::map TDataMapFacePtrInt; - typedef std::map 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 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 ElementsOnSurfacePtr; - - - /* - FILTER - */ - class Filter{ - public: - Filter(); - virtual ~Filter(); - virtual void SetPredicate(PredicatePtr thePred); - typedef std::vector TIdSequence; - virtual TIdSequence GetElementsId( SMDS_Mesh* theMesh ); - - protected: - PredicatePtr myPredicate; - }; - }; -}; + } +} #endif diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 5d80d26fa..c3a7abe32 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -30,10 +30,10 @@ #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 #include @@ -69,12 +69,12 @@ #include #include +#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; @@ -678,6 +678,14 @@ void SMESH_Actor::SetControlMode(eControl theMode){ 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(); diff --git a/src/OBJECT/SMESH_Actor.h b/src/OBJECT/SMESH_Actor.h index b2f68c394..2fad89f01 100644 --- a/src/OBJECT/SMESH_Actor.h +++ b/src/OBJECT/SMESH_Actor.h @@ -146,7 +146,8 @@ class SMESH_Actor : public SALOME_Actor{ 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;} diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index 79d20d813..f66717e8d 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -29,14 +29,13 @@ #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 #include @@ -61,12 +60,12 @@ #include +#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; @@ -304,7 +303,7 @@ void SMESH_DeviceActor::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor 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]), diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index 6621177cc..2ec5ea38e 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -27,8 +27,9 @@ #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) @@ -117,7 +118,6 @@ namespace{ 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()) @@ -136,7 +136,6 @@ namespace{ 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()) @@ -156,7 +155,6 @@ namespace{ 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()) @@ -177,7 +175,6 @@ namespace{ 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()) @@ -198,7 +195,6 @@ namespace{ 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()) @@ -220,7 +216,6 @@ namespace{ 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()) @@ -243,7 +238,6 @@ namespace{ 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()) @@ -406,7 +400,6 @@ void SMESH_VisualObj::buildNodePrs() { vtkPoints* aPoints = vtkPoints::New(); createPoints( aPoints ); - int nbPoints = aPoints->GetNumberOfPoints(); myGrid->SetPoints( aPoints ); aPoints->Delete(); @@ -414,6 +407,7 @@ void SMESH_VisualObj::buildNodePrs() // Create cells /* + int nbPoints = aPoints->GetNumberOfPoints(); vtkIdList *anIdList = vtkIdList::New(); anIdList->SetNumberOfIds( 1 ); @@ -650,7 +644,6 @@ void SMESH_MeshObj::Update( int theIsClear ) 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) diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 71a4d3c11..5aae366e8 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -28,15 +28,14 @@ #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 #include #include #include @@ -48,7 +47,10 @@ #include +#include "utilities.h" + using namespace std; +using namespace SMESH::Controls; typedef map TNodeNodeMap; typedef map > TNodeOfNodeListMap; @@ -493,7 +495,7 @@ bool SMESH_MeshEditor::Reorient (const SMDS_MeshElement * theFace) 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() ); @@ -649,7 +651,7 @@ double getAngle(const SMDS_MeshElement * tr1, 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; @@ -1315,13 +1317,13 @@ void centroidalSmooth(SMESHDS_Mesh * theMesh, 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( 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 ); @@ -1453,7 +1455,7 @@ void SMESH_MeshEditor::Smooth (set & theElems, 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 ) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 78f27d222..ca55141a1 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -292,14 +292,12 @@ namespace{ 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()); @@ -530,6 +528,10 @@ namespace{ 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; @@ -1076,7 +1078,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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(), @@ -1092,7 +1094,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) if ( myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK ) { EmitSignalDeactivateDialog(); - SMESHGUI_FilterDlg *aDlg = new SMESHGUI_FilterDlg( parent, SMESH::EDGE ); + new SMESHGUI_FilterDlg( parent, SMESH::EDGE ); } break; } @@ -1108,7 +1110,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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; } @@ -1216,7 +1218,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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(), @@ -1231,7 +1233,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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; } @@ -1240,7 +1242,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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; } @@ -1249,7 +1251,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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; } @@ -1258,7 +1260,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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; } @@ -1331,7 +1333,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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(), @@ -1346,7 +1348,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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(), @@ -1361,7 +1363,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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(), @@ -1544,7 +1546,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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(); @@ -1552,7 +1554,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) Sel->AddIObject( It.Value() ); } else - SMESHGUI_MeshInfosDlg *aDlg = new SMESHGUI_MeshInfosDlg(parent, "", false); + new SMESHGUI_MeshInfosDlg(parent, "", false); break; } @@ -1567,7 +1569,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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(); @@ -1575,7 +1577,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) Sel->AddIObject( It.Value() ); } else - SMESHGUI_StandardMeshInfosDlg *aDlg = new SMESHGUI_StandardMeshInfosDlg(parent, "", false); + new SMESHGUI_StandardMeshInfosDlg(parent, "", false); break; } @@ -1825,8 +1827,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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(), @@ -1842,7 +1843,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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(), @@ -1857,7 +1858,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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 { @@ -1873,7 +1874,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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 { @@ -1889,7 +1890,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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 { @@ -1905,7 +1906,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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(), @@ -1920,7 +1921,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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(), @@ -1935,7 +1936,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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(), @@ -1950,7 +1951,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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(), @@ -1965,7 +1966,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) 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(), @@ -1980,16 +1981,14 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) { 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; } @@ -2007,7 +2006,8 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent) } break; - case 6016: // CONTROLS + case 6017: // CONTROLS + case 6016: case 6015: case 6014: case 6013: @@ -2332,13 +2332,13 @@ bool SMESHGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString 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 ); @@ -2374,6 +2374,8 @@ bool SMESHGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString 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: @@ -2387,12 +2389,12 @@ bool SMESHGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString 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 ); @@ -2401,7 +2403,10 @@ bool SMESHGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString 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 } } diff --git a/src/SMESHGUI/SMESH_msg_en.po b/src/SMESHGUI/SMESH_msg_en.po index 8a0a4163b..924ef21ff 100644 --- a/src/SMESHGUI/SMESH_msg_en.po +++ b/src/SMESHGUI/SMESH_msg_en.po @@ -1107,6 +1107,9 @@ msgstr "Taper" msgid "ASPECTRATIO_ELEMENTS" msgstr "Aspect Ratio" +msgid "ASPECTRATIO_3D_ELEMENTS" +msgstr "Aspect Ratio 3D" + msgid "MINIMUMANGLE_ELEMENTS" msgstr "Minimum Angle" diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index 052053500..0c7c9a639 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -334,6 +334,22 @@ FunctorType AspectRatio_i::GetFunctorType() } +/* + 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 @@ -974,6 +990,14 @@ AspectRatio_ptr FilterManager_i::CreateAspectRatio() } +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(); @@ -1405,6 +1429,9 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria case SMESH::FT_AspectRatio: aFunctor = aFilterMgr->CreateAspectRatio(); break; + case SMESH::FT_AspectRatio3D: + aFunctor = aFilterMgr->CreateAspectRatio3D(); + break; case SMESH::FT_Warping: aFunctor = aFilterMgr->CreateWarping(); break; diff --git a/src/SMESH_I/SMESH_Filter_i.hxx b/src/SMESH_I/SMESH_Filter_i.hxx index 2c3efb20e..d931d0560 100644 --- a/src/SMESH_I/SMESH_Filter_i.hxx +++ b/src/SMESH_I/SMESH_Filter_i.hxx @@ -35,7 +35,7 @@ #include #include "SALOME_GenericObj_i.hh" -#include "SMESH_Controls.hxx" +#include "SMESH_ControlsDef.hxx" class SMESHDS_Mesh; @@ -141,6 +141,19 @@ public: }; +/* + 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 @@ -583,6 +596,7 @@ public: FilterManager_i(); MinimumAngle_ptr CreateMinimumAngle(); AspectRatio_ptr CreateAspectRatio(); + AspectRatio3D_ptr CreateAspectRatio3D(); Warping_ptr CreateWarping(); Taper_ptr CreateTaper(); Skew_ptr CreateSkew(); diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 851f61310..1108d14aa 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -41,18 +41,18 @@ #include "OpUtil.hxx" #include "TCollection_AsciiString.hxx" -#include -#include -#include #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 +#include +#include + #include #include -// _CS_gbo_050504 Ajout explicite du sstream pour ostringstream #include #ifdef _DEBUG_