Version: 6.3.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends

StdMeshers_ProjectionSource1D Class Reference

This hypothesis specifies a meshed edge to take a mesh pattern from and optionally association of vertices between the source edge and a target one (where a hipothesis is assigned to) More...

#include <StdMeshers_ProjectionSource1D.hxx>

Inheritance diagram for StdMeshers_ProjectionSource1D:
Inheritance graph
[legend]

Public Types

enum  Hypothesis_Status {
  HYP_OK = 0, HYP_MISSING, HYP_CONCURENT, HYP_BAD_PARAMETER,
  HYP_HIDDEN_ALGO, HYP_HIDING_ALGO, HYP_UNKNOWN_FATAL, HYP_INCOMPATIBLE,
  HYP_NOTCONFORM, HYP_ALREADY_EXIST, HYP_BAD_DIM, HYP_BAD_SUBSHAPE,
  HYP_BAD_GEOMETRY, HYP_NEED_SHAPE
}
enum  hypothesis_type {
  PARAM_ALGO, ALGO_0D, ALGO_1D, ALGO_2D,
  ALGO_3D
}

Public Member Functions

 StdMeshers_ProjectionSource1D (int hypId, int studyId, SMESH_Gen *gen)
 StdMeshers_ProjectionSource1D.StdMeshers_ProjectionSource1D.
virtual ~StdMeshers_ProjectionSource1D ()
 StdMeshers_ProjectionSource1D.~StdMeshers_ProjectionSource1D.
void SetSourceEdge (const TopoDS_Shape &edge) throw ( SALOME_Exception )
 Sets source <edge> to take a mesh pattern from.
TopoDS_Shape GetSourceEdge () const
 Returns the source edge or a group containing edges.
bool IsCompoundSource () const
 Returns true the source edge is a group of edges.
void SetSourceMesh (SMESH_Mesh *mesh)
 Sets source <mesh> to take a mesh pattern from.
SMESH_MeshGetSourceMesh () const
 Return source mesh.
void SetVertexAssociation (const TopoDS_Shape &sourceVertex, const TopoDS_Shape &targetVertex) throw ( SALOME_Exception )
 Sets vertex association between the source edge and the target one.
TopoDS_Vertex GetSourceVertex () const
 Returns the vertex associated with the target vertex.
TopoDS_Vertex GetTargetVertex () const
 Returns the vertex associated with the source vertex.
bool HasVertexAssociation () const
 Test if vertex association defined.
void GetStoreParams (TopoDS_Shape &s1, TopoDS_Shape &s2, TopoDS_Shape &s3) const
 Return all parameters.
void RestoreParams (const TopoDS_Shape &s1, const TopoDS_Shape &s2, const TopoDS_Shape &s3, SMESH_Mesh *mesh)
 Set all parameters without notifying on modification.
virtual std::ostream & SaveTo (std::ostream &save)
virtual std::istream & LoadFrom (std::istream &load)
virtual bool SetParametersByMesh (const SMESH_Mesh *theMesh, const TopoDS_Shape &theShape)
 Initialize parameters by the mesh built on the geometry.
virtual bool SetParametersByDefaults (const TDefaults &dflts, const SMESH_Mesh *theMesh=0)
 Initialize my parameter values by default parameters.
virtual int GetDim () const
int GetStudyId () const
virtual void NotifySubMeshesHypothesisModification ()
virtual int GetShapeType () const
virtual const char * GetLibName () const
void SetLibName (const char *theLibName)
void SetParameters (const char *theParameters)
char * GetParameters () const
void SetLastParameters (const char *theParameters)
char * GetLastParameters () const
void ClearParameters ()
virtual bool IsAuxiliary () const
 Return true if me is an auxiliary hypothesis.
SMESH_MeshGetMeshByPersistentID (int id)
 Find a mesh with given persistent ID.
const char * GetName () const
int GetID () const
int GetType () const
virtual bool operator== (const SMESHDS_Hypothesis &other) const
 Equality.
bool operator!= (const SMESHDS_Hypothesis &other) const

Static Public Member Functions

static bool IsStatusFatal (Hypothesis_Status theStatus)

Protected Attributes

TopoDS_Shape _sourceEdge
SMESH_Mesh_sourceMesh
TopoDS_Vertex _sourceVertex
TopoDS_Vertex _targetVertex
SMESH_Gen_gen
int _studyId
int _shapeType
int _param_algo_dim
std::string _name
int _hypId
int _type

Friends

std::ostream & operator<< (std::ostream &save, StdMeshers_ProjectionSource1D &hyp)
std::istream & operator>> (std::istream &load, StdMeshers_ProjectionSource1D &hyp)

Detailed Description

This hypothesis specifies a meshed edge to take a mesh pattern from and optionally association of vertices between the source edge and a target one (where a hipothesis is assigned to)

Definition at line 48 of file StdMeshers_ProjectionSource1D.hxx.


Member Enumeration Documentation

Enumerator:
HYP_OK 
HYP_MISSING 
HYP_CONCURENT 
HYP_BAD_PARAMETER 
HYP_HIDDEN_ALGO 
HYP_HIDING_ALGO 
HYP_UNKNOWN_FATAL 
HYP_INCOMPATIBLE 
HYP_NOTCONFORM 
HYP_ALREADY_EXIST 
HYP_BAD_DIM 
HYP_BAD_SUBSHAPE 
HYP_BAD_GEOMETRY 
HYP_NEED_SHAPE 

Definition at line 50 of file SMESH_Hypothesis.hxx.

  {
    HYP_OK = 0,
    HYP_MISSING,      // algo misses a hypothesis
    HYP_CONCURENT,    // several applicable hypotheses
    HYP_BAD_PARAMETER,// hypothesis has a bad parameter value
    HYP_HIDDEN_ALGO,  // an algo is hidden by an upper dim algo generating all-dim elements
    HYP_HIDING_ALGO,  // an algo hides lower dim algos by generating all-dim elements
    HYP_UNKNOWN_FATAL,//  --- all statuses below should be considered as fatal
                      //      for Add/RemoveHypothesis operations
    HYP_INCOMPATIBLE, // hypothesis does not fit algo
    HYP_NOTCONFORM,   // not conform mesh is produced appling a hypothesis
    HYP_ALREADY_EXIST,// such hypothesis already exist
    HYP_BAD_DIM,      // bad dimension
    HYP_BAD_SUBSHAPE, // shape is neither the main one, nor its subshape, nor a group
    HYP_BAD_GEOMETRY, // shape geometry mismatches algorithm's expectation
    HYP_NEED_SHAPE    // algorithm can work on shape only
  };
Enumerator:
PARAM_ALGO 
ALGO_0D 
ALGO_1D 
ALGO_2D 
ALGO_3D 

Definition at line 53 of file SMESHDS_Hypothesis.hxx.


Constructor & Destructor Documentation

StdMeshers_ProjectionSource1D::StdMeshers_ProjectionSource1D ( int  hypId,
int  studyId,
SMESH_Gen gen 
)

StdMeshers_ProjectionSource1D.StdMeshers_ProjectionSource1D.

Constructor

Definition at line 47 of file StdMeshers_ProjectionSource1D.cxx.

References SMESHDS_Hypothesis._name, SMESH_Hypothesis._param_algo_dim, and _sourceMesh.

  : SMESH_Hypothesis(hypId, studyId, gen)
{
  _name = "ProjectionSource1D"; // used by Projection_1D
  _param_algo_dim = 1; // 1D
  _sourceMesh = 0;
}
StdMeshers_ProjectionSource1D::~StdMeshers_ProjectionSource1D ( ) [virtual]

StdMeshers_ProjectionSource1D.~StdMeshers_ProjectionSource1D.

Destructor

Definition at line 64 of file StdMeshers_ProjectionSource1D.cxx.

References MESSAGE.

{
  MESSAGE( "StdMeshers_ProjectionSource1D::~StdMeshers_ProjectionSource1D" );
}

Member Function Documentation

void SMESH_Hypothesis.ClearParameters ( ) [inherited]
int SMESH_Hypothesis::GetDim ( ) const [virtual, inherited]

Definition at line 74 of file SMESH_Hypothesis.cxx.

{
  int dim = 0;
  switch (_type)
    {
    case ALGO_1D: dim = 1; break;
    case ALGO_2D: dim = 2; break;
    case ALGO_3D: dim = 3; break;
    case PARAM_ALGO:
      dim = ( _param_algo_dim < 0 ) ? -_param_algo_dim : _param_algo_dim; break;
    }
  return dim;
}
int SMESHDS_Hypothesis::GetID ( ) const [inherited]

Definition at line 73 of file SMESHDS_Hypothesis.cxx.

Referenced by SMESHDS_Document.AddHypothesis(), and SMESH_Mesh_i.GetHypothesisList().

{
  return _hypId;
}
char* SMESH_Hypothesis.GetLastParameters ( ) const [inherited]
virtual const char* SMESH_Hypothesis.GetLibName ( ) const [virtual, inherited]
SMESH_Mesh * SMESH_Hypothesis::GetMeshByPersistentID ( int  id) [inherited]

Find a mesh with given persistent ID.

Definition at line 160 of file SMESH_Hypothesis.cxx.

References studyContextStruct.mapMesh, and PAL_MESH_041_mesh.mesh.

{
  StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
  map<int, SMESH_Mesh*>::iterator itm = itm = myStudyContext->mapMesh.begin();
  for ( ; itm != myStudyContext->mapMesh.end(); itm++)
  {
    SMESH_Mesh* mesh = (*itm).second;
    if ( mesh->GetMeshDS()->GetPersistentId() == id )
      return mesh;
  }
  return 0;
}
const char * SMESHDS_Hypothesis::GetName ( ) const [inherited]
char* SMESH_Hypothesis.GetParameters ( ) const [inherited]
int SMESH_Hypothesis::GetShapeType ( ) const [virtual, inherited]

Definition at line 94 of file SMESH_Hypothesis.cxx.

{
  return _shapeType;
}
TopoDS_Shape StdMeshers_ProjectionSource1D.GetSourceEdge ( ) const

Returns the source edge or a group containing edges.

Definition at line 65 of file StdMeshers_ProjectionSource1D.hxx.

{ return _sourceEdge; }
SMESH_Mesh* StdMeshers_ProjectionSource1D.GetSourceMesh ( ) const

Return source mesh.

Definition at line 81 of file StdMeshers_ProjectionSource1D.hxx.

{ return _sourceMesh; }
TopoDS_Vertex StdMeshers_ProjectionSource1D.GetSourceVertex ( ) const

Returns the vertex associated with the target vertex.

Result may be nil if association not set

Definition at line 95 of file StdMeshers_ProjectionSource1D.hxx.

{ return _sourceVertex; }
void StdMeshers_ProjectionSource1D.GetStoreParams ( TopoDS_Shape &  s1,
TopoDS_Shape &  s2,
TopoDS_Shape &  s3 
) const

Return all parameters.

int SMESH_Hypothesis.GetStudyId ( ) const [inherited]
TopoDS_Vertex StdMeshers_ProjectionSource1D.GetTargetVertex ( ) const

Returns the vertex associated with the source vertex.

Result may be nil if association not set

Definition at line 101 of file StdMeshers_ProjectionSource1D.hxx.

{ return _targetVertex; }
int SMESHDS_Hypothesis::GetType ( ) const [inherited]
bool StdMeshers_ProjectionSource1D.HasVertexAssociation ( ) const

Test if vertex association defined.

Return values:
bool- test result

Definition at line 107 of file StdMeshers_ProjectionSource1D.hxx.

  { return ( !_sourceVertex.IsNull() && !_targetVertex.IsNull() ); }
virtual bool SMESH_Hypothesis.IsAuxiliary ( ) const [virtual, inherited]

Return true if me is an auxiliary hypothesis.

Return values:
bool- auxiliary or not

An auxiliary hypothesis is optional, i.e. an algorithm can work without it and another hypothesis of the same dimention can be assigned to the shape

Definition at line 114 of file SMESH_Hypothesis.hxx.

References SMESHDS_Hypothesis.GetType().

  { return GetType() == PARAM_ALGO && _param_algo_dim < 0; }
bool StdMeshers_ProjectionSource1D.IsCompoundSource ( ) const

Returns true the source edge is a group of edges.

Definition at line 70 of file StdMeshers_ProjectionSource1D.hxx.

  { return !_sourceEdge.IsNull() && _sourceEdge.ShapeType() == TopAbs_COMPOUND; }
static bool SMESH_Hypothesis.IsStatusFatal ( Hypothesis_Status  theStatus) [static, inherited]
virtual std::istream& StdMeshers_ProjectionSource1D.LoadFrom ( std::istream &  load) [virtual]

Implements SMESHDS_Hypothesis.

virtual void SMESH_Hypothesis.NotifySubMeshesHypothesisModification ( ) [virtual, inherited]
bool SMESHDS_Hypothesis.operator!= ( const SMESHDS_Hypothesis other) const [inherited]

Definition at line 51 of file SMESHDS_Hypothesis.hxx.

{ return !(*this==other); }
bool SMESHDS_Hypothesis::operator== ( const SMESHDS_Hypothesis other) const [virtual, inherited]

Equality.

Definition at line 95 of file SMESHDS_Hypothesis.cxx.

References SMESHDS_Hypothesis._name.

{
  if ( this == &other )
    return true;
  if ( _name != other._name )
    return false;
  ostringstream mySave, otherSave;
  ((SMESHDS_Hypothesis*)this  )->SaveTo(mySave);
  ((SMESHDS_Hypothesis*)&other)->SaveTo(otherSave);
  return mySave.str() == otherSave.str();
}
void StdMeshers_ProjectionSource1D.RestoreParams ( const TopoDS_Shape &  s1,
const TopoDS_Shape &  s2,
const TopoDS_Shape &  s3,
SMESH_Mesh mesh 
)

Set all parameters without notifying on modification.

virtual std::ostream& StdMeshers_ProjectionSource1D.SaveTo ( std::ostream &  save) [virtual]

Implements SMESHDS_Hypothesis.

void SMESH_Hypothesis::SetLastParameters ( const char *  theParameters) [inherited]

Definition at line 224 of file SMESH_Hypothesis.cxx.

{
  _lastParameters = string(theParameters);
}
void SMESH_Hypothesis.SetLibName ( const char *  theLibName) [inherited]
void SMESH_Hypothesis::SetParameters ( const char *  theParameters) [inherited]

Definition at line 178 of file SMESH_Hypothesis.cxx.

{
  string aNewParameters(theParameters);
  if(aNewParameters.size()==0 && _parameters.size()==0)
    aNewParameters = " ";
  if(_parameters.size()>0)
    _parameters +="|";
  _parameters +=aNewParameters;
  SetLastParameters(theParameters);
}
virtual bool StdMeshers_ProjectionSource1D.SetParametersByDefaults ( const TDefaults dflts,
const SMESH_Mesh theMesh = 0 
) [virtual]

Initialize my parameter values by default parameters.

Return values:
bool- true if parameter values have been successfully defined

Implements SMESH_Hypothesis.

virtual bool StdMeshers_ProjectionSource1D.SetParametersByMesh ( const SMESH_Mesh theMesh,
const TopoDS_Shape &  theShape 
) [virtual]

Initialize parameters by the mesh built on the geometry.

Parameters:
theMesh- the built mesh
theShape- the geometry of interest
Return values:
bool- true if parameter values have been successfully defined

Implementation does noting

Implements SMESH_Hypothesis.

void StdMeshers_ProjectionSource1D::SetSourceEdge ( const TopoDS_Shape &  edge) throw ( SALOME_Exception )

Sets source <edge> to take a mesh pattern from.

Definition at line 75 of file StdMeshers_ProjectionSource1D.cxx.

References SMESH_test.edge.

{
  if ( edge.IsNull() )
    throw SALOME_Exception(LOCALIZED("Null edge is not allowed"));

  if ( edge.ShapeType() != TopAbs_EDGE && edge.ShapeType() != TopAbs_COMPOUND )
    throw SALOME_Exception(LOCALIZED("Wrong shape type"));

  if ( !_sourceEdge.IsSame( edge ) )
  {
    _sourceEdge = edge;

    NotifySubMeshesHypothesisModification();
  }
}
void StdMeshers_ProjectionSource1D::SetSourceMesh ( SMESH_Mesh mesh)

Sets source <mesh> to take a mesh pattern from.

Definition at line 128 of file StdMeshers_ProjectionSource1D.cxx.

References PAL_MESH_041_mesh.mesh.

void StdMeshers_ProjectionSource1D::SetVertexAssociation ( const TopoDS_Shape &  sourceVertex,
const TopoDS_Shape &  targetVertex 
) throw ( SALOME_Exception )

Sets vertex association between the source edge and the target one.

This parameter is optional

Definition at line 99 of file StdMeshers_ProjectionSource1D.cxx.

{
  if ( sourceVertex.IsNull() != targetVertex.IsNull() )
    throw SALOME_Exception(LOCALIZED("Two or none vertices must be provided"));

  if ( !sourceVertex.IsNull() ) {
    if ( sourceVertex.ShapeType() != TopAbs_VERTEX ||
         targetVertex.ShapeType() != TopAbs_VERTEX )
      throw SALOME_Exception(LOCALIZED("Wrong shape type"));
  }

  if ( !_sourceVertex.IsSame( sourceVertex ) ||
       !_targetVertex.IsSame( targetVertex ) )
  {
    _sourceVertex = TopoDS::Vertex( sourceVertex );
    _targetVertex = TopoDS::Vertex( targetVertex );

    NotifySubMeshesHypothesisModification();
  }
}

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  save,
StdMeshers_ProjectionSource1D hyp 
) [friend]

Definition at line 170 of file StdMeshers_ProjectionSource1D.cxx.

{
  return hyp.SaveTo( save );
}
std::istream& operator>> ( std::istream &  load,
StdMeshers_ProjectionSource1D hyp 
) [friend]

Definition at line 181 of file StdMeshers_ProjectionSource1D.cxx.

{
  return hyp.LoadFrom( load );
}

Field Documentation

SMESH_Gen* SMESH_Hypothesis._gen [protected, inherited]

Definition at line 123 of file SMESH_Hypothesis.hxx.

Referenced by SMESH_Hypothesis.SMESH_Hypothesis().

int SMESHDS_Hypothesis._hypId [protected, inherited]

Definition at line 57 of file SMESHDS_Hypothesis.hxx.

Referenced by SMESH_Hypothesis.SMESH_Hypothesis().

std::string SMESHDS_Hypothesis._name [protected, inherited]

Definition at line 56 of file SMESHDS_Hypothesis.hxx.

Referenced by SMESHDS_Hypothesis.operator==(), StdMeshers_Arithmetic1D.StdMeshers_Arithmetic1D(), StdMeshers_AutomaticLength.StdMeshers_AutomaticLength(), StdMeshers_Deflection1D.StdMeshers_Deflection1D(), StdMeshers_FixedPoints1D.StdMeshers_FixedPoints1D(), StdMeshers_ImportSource1D.StdMeshers_ImportSource1D(), StdMeshers_ImportSource2D.StdMeshers_ImportSource2D(), StdMeshers_LayerDistribution.StdMeshers_LayerDistribution(), StdMeshers_LayerDistribution2D.StdMeshers_LayerDistribution2D(), StdMeshers_LengthFromEdges.StdMeshers_LengthFromEdges(), StdMeshers_LocalLength.StdMeshers_LocalLength(), StdMeshers_MaxElementArea.StdMeshers_MaxElementArea(), StdMeshers_MaxElementVolume.StdMeshers_MaxElementVolume(), StdMeshers_MaxLength.StdMeshers_MaxLength(), StdMeshers_NotConformAllowed.StdMeshers_NotConformAllowed(), StdMeshers_NumberOfLayers.StdMeshers_NumberOfLayers(), StdMeshers_NumberOfLayers2D.StdMeshers_NumberOfLayers2D(), StdMeshers_NumberOfSegments.StdMeshers_NumberOfSegments(), StdMeshers_ProjectionSource1D(), StdMeshers_ProjectionSource2D.StdMeshers_ProjectionSource2D(), StdMeshers_ProjectionSource3D.StdMeshers_ProjectionSource3D(), StdMeshers_Propagation.StdMeshers_Propagation(), StdMeshers_QuadrangleParams.StdMeshers_QuadrangleParams(), StdMeshers_QuadranglePreference.StdMeshers_QuadranglePreference(), StdMeshers_QuadraticMesh.StdMeshers_QuadraticMesh(), StdMeshers_StartEndLength.StdMeshers_StartEndLength(), StdMeshers_TrianglePreference.StdMeshers_TrianglePreference(), and StdMeshers_ViscousLayers.StdMeshers_ViscousLayers().

int SMESH_Hypothesis._param_algo_dim [protected, inherited]

Definition at line 126 of file SMESH_Hypothesis.hxx.

Referenced by SMESH_Hypothesis.SMESH_Hypothesis(), StdMeshers_Arithmetic1D.StdMeshers_Arithmetic1D(), StdMeshers_AutomaticLength.StdMeshers_AutomaticLength(), StdMeshers_Deflection1D.StdMeshers_Deflection1D(), StdMeshers_FixedPoints1D.StdMeshers_FixedPoints1D(), StdMeshers_ImportSource1D.StdMeshers_ImportSource1D(), StdMeshers_ImportSource2D.StdMeshers_ImportSource2D(), StdMeshers_LayerDistribution.StdMeshers_LayerDistribution(), StdMeshers_LayerDistribution2D.StdMeshers_LayerDistribution2D(), StdMeshers_LengthFromEdges.StdMeshers_LengthFromEdges(), StdMeshers_LocalLength.StdMeshers_LocalLength(), StdMeshers_MaxElementArea.StdMeshers_MaxElementArea(), StdMeshers_MaxElementVolume.StdMeshers_MaxElementVolume(), StdMeshers_MaxLength.StdMeshers_MaxLength(), StdMeshers_NotConformAllowed.StdMeshers_NotConformAllowed(), StdMeshers_NumberOfLayers.StdMeshers_NumberOfLayers(), StdMeshers_NumberOfLayers2D.StdMeshers_NumberOfLayers2D(), StdMeshers_NumberOfSegments.StdMeshers_NumberOfSegments(), StdMeshers_ProjectionSource1D(), StdMeshers_ProjectionSource2D.StdMeshers_ProjectionSource2D(), StdMeshers_ProjectionSource3D.StdMeshers_ProjectionSource3D(), StdMeshers_Propagation.StdMeshers_Propagation(), StdMeshers_QuadrangleParams.StdMeshers_QuadrangleParams(), StdMeshers_QuadranglePreference.StdMeshers_QuadranglePreference(), StdMeshers_QuadraticMesh.StdMeshers_QuadraticMesh(), StdMeshers_StartEndLength.StdMeshers_StartEndLength(), StdMeshers_TrianglePreference.StdMeshers_TrianglePreference(), and StdMeshers_ViscousLayers.StdMeshers_ViscousLayers().

int SMESH_Hypothesis._shapeType [protected, inherited]

Definition at line 125 of file SMESH_Hypothesis.hxx.

Referenced by SMESH_Hypothesis.SMESH_Hypothesis().

Definition at line 148 of file StdMeshers_ProjectionSource1D.hxx.

Definition at line 149 of file StdMeshers_ProjectionSource1D.hxx.

Referenced by StdMeshers_ProjectionSource1D().

Definition at line 150 of file StdMeshers_ProjectionSource1D.hxx.

int SMESH_Hypothesis._studyId [protected, inherited]

Definition at line 124 of file SMESH_Hypothesis.hxx.

Referenced by SMESH_Hypothesis.SMESH_Hypothesis().

Definition at line 151 of file StdMeshers_ProjectionSource1D.hxx.

int SMESHDS_Hypothesis._type [protected, inherited]

Definition at line 58 of file SMESHDS_Hypothesis.hxx.

Referenced by SMESH_Hypothesis.SMESH_Hypothesis().

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS