Back to index

salome-smesh  6.5.0
Public Member Functions | Private Types | Private Attributes
StdMeshers_ProjectionSource1D_i 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_i.hxx>

Collaboration diagram for StdMeshers_ProjectionSource1D_i:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 StdMeshers_ProjectionSource1D_i (PortableServer::POA_ptr thePOA, int theStudyId,::SMESH_Gen *theGenImpl)
 StdMeshers_ProjectionSource1D_i::StdMeshers_ProjectionSource1D_i.
virtual ~StdMeshers_ProjectionSource1D_i ()
 StdMeshers_ProjectionSource1D_i::~StdMeshers_ProjectionSource1D_i.
void SetSourceEdge (GEOM::GEOM_Object_ptr edge) throw ( SALOME::SALOME_Exception )
 Sets source <edge> or a group containing edges to take a mesh pattern from.
GEOM::GEOM_Object_ptr GetSourceEdge ()
 Returns the source edge or a group containing edges.
void SetSourceMesh (SMESH::SMESH_Mesh_ptr mesh) throw ( SALOME::SALOME_Exception )
 Sets source <mesh> to take a mesh pattern from.
SMESH::SMESH_Mesh_ptr GetSourceMesh ()
 Return source mesh.
void SetVertexAssociation (GEOM::GEOM_Object_ptr sourceVertex, GEOM::GEOM_Object_ptr targetVertex) throw ( SALOME::SALOME_Exception )
 Sets vertex association between the source edge and the target one.
GEOM::GEOM_Object_ptr GetSourceVertex ()
 Returns the vertex associated with the target vertex.
GEOM::GEOM_Object_ptr GetTargetVertex ()
 Returns the vertex associated with the source vertex.
::StdMeshers_ProjectionSource1D * GetImpl ()
 StdMeshers_ProjectionSource1D_i::GetImpl.
CORBA::Boolean IsDimSupported (SMESH::Dimension type)
 Verify whether hypothesis supports given entity type.
virtual char * SaveTo ()
 Write parameters in a string.
virtual void LoadFrom (const char *theStream)
 Retrieve parameters from the string.

Private Types

enum  { SRC_EDGE = 0, SRC_VERTEX, TGT_VERTEX, NB_SHAPES }

Private Attributes

std::string myShapeEntries [NB_SHAPES]
SMESH::SMESH_Mesh_var myCorbaMesh

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_i.hxx.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
SRC_EDGE 
SRC_VERTEX 
TGT_VERTEX 
NB_SHAPES 

Definition at line 117 of file StdMeshers_ProjectionSource1D_i.hxx.


Constructor & Destructor Documentation

StdMeshers_ProjectionSource1D_i::StdMeshers_ProjectionSource1D_i ( PortableServer::POA_ptr  thePOA,
int  theStudyId,
::SMESH_Gen *  theGenImpl 
)

StdMeshers_ProjectionSource1D_i::StdMeshers_ProjectionSource1D_i.

Constructor

Definition at line 50 of file StdMeshers_ProjectionSource1D_i.cxx.

                                     : SALOME::GenericObj_i( thePOA ), 
                                         SMESH_Hypothesis_i( thePOA )
{
  MESSAGE( "StdMeshers_ProjectionSource1D_i::StdMeshers_ProjectionSource1D_i" );
  myBaseImpl = new ::StdMeshers_ProjectionSource1D( theGenImpl->GetANewId(),
                                                    theStudyId,
                                                    theGenImpl );
}

StdMeshers_ProjectionSource1D_i::~StdMeshers_ProjectionSource1D_i.

Destructor

Definition at line 69 of file StdMeshers_ProjectionSource1D_i.cxx.

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

Member Function Documentation

StdMeshers_ProjectionSource1D * StdMeshers_ProjectionSource1D_i::GetImpl ( )

StdMeshers_ProjectionSource1D_i::GetImpl.

Get implementation

Definition at line 222 of file StdMeshers_ProjectionSource1D_i.cxx.

{
  return ( ::StdMeshers_ProjectionSource1D* )myBaseImpl;
}

Returns the source edge or a group containing edges.

Returns the source edge or a group containing edge.

Definition at line 176 of file StdMeshers_ProjectionSource1D_i.cxx.

Here is the call graph for this function:

Return source mesh.

Definition at line 164 of file StdMeshers_ProjectionSource1D_i.cxx.

{
  SMESH::SMESH_Mesh_var mesh = myCorbaMesh;
  return mesh._retn();
}

Returns the vertex associated with the target vertex.

Result may be nil if association not set

Definition at line 191 of file StdMeshers_ProjectionSource1D_i.cxx.

Here is the call graph for this function:

Returns the vertex associated with the source vertex.

Result may be nil if association not set

Definition at line 206 of file StdMeshers_ProjectionSource1D_i.cxx.

Here is the call graph for this function:

Verify whether hypothesis supports given entity type.

Parameters:
type- dimension (see SMESH::Dimension enumeration)
Return values:
CORBA::Boolean- TRUE if dimension is supported, FALSE otherwise

Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)

Definition at line 236 of file StdMeshers_ProjectionSource1D_i.cxx.

{
  return type == SMESH::DIM_1D;
}
void StdMeshers_ProjectionSource1D_i::LoadFrom ( const char *  theStream) [virtual]

Retrieve parameters from the string.

Parameters:
theStream- the input string

Definition at line 269 of file StdMeshers_ProjectionSource1D_i.cxx.

{
  ASSERT( myBaseImpl );
  std::istringstream is( theStream );

  TopoDS_Shape shapes[ NB_SHAPES ];
  for ( int i = 0; i < NB_SHAPES; ++i )
    shapes[ i ] = StdMeshers_ObjRefUlils::LoadFromStream( is );
  SMESH::SMESH_Mesh_var mesh = 
    StdMeshers_ObjRefUlils::LoadObjectFromStream< SMESH::SMESH_Mesh >( is );

  ::SMESH_Mesh* meshImpl = 0;

  if ( !CORBA::is_nil( mesh ))
  {
    SMESH_Mesh_i* mesh_i = SMESH::DownCast< SMESH_Mesh_i* >( mesh );
    if ( mesh_i )
      meshImpl = &mesh_i->GetImpl();
  }

  myCorbaMesh = SMESH::SMESH_Mesh::_duplicate( mesh );
  GetImpl()->SetSourceMesh       ( meshImpl );
  GetImpl()->SetSourceEdge       ( shapes[ SRC_EDGE ] );
  GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX ],
                                   shapes[ TGT_VERTEX ]);

  myBaseImpl->LoadFrom( is );

  std::istringstream str( theStream );
  for ( int i = 0; i < NB_SHAPES; ++i )
    str >> myShapeEntries[ i ];
}

Here is the call graph for this function:

Write parameters in a string.

Return values:
char*- resulting string

Definition at line 248 of file StdMeshers_ProjectionSource1D_i.cxx.

{
  ASSERT( myBaseImpl );
  std::ostringstream os;

  for ( int i = 0; i < NB_SHAPES; ++i )
    StdMeshers_ObjRefUlils::SaveToStream( myShapeEntries[ i ], os );
  StdMeshers_ObjRefUlils::SaveToStream( GetSourceMesh(), os );

  myBaseImpl->SaveTo( os );

  return CORBA::string_dup( os.str().c_str() );
}

Here is the call graph for this function:

void StdMeshers_ProjectionSource1D_i::SetSourceEdge ( GEOM::GEOM_Object_ptr  edge) throw ( SALOME::SALOME_Exception )

Sets source <edge> or a group containing edges to take a mesh pattern from.

Definition at line 80 of file StdMeshers_ProjectionSource1D_i.cxx.

{
  ASSERT( myBaseImpl );
  try {
    this->GetImpl()->SetSourceEdge( StdMeshers_ObjRefUlils::GeomObjectToShape( edge ));
    CORBA::String_var entry = edge->GetStudyEntry();
    myShapeEntries[ SRC_EDGE ] = entry.in();
  }
  catch ( SALOME_Exception& S_ex ) {
    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
  }
  // Update Python script
  SMESH::TPythonDump() << _this() << ".SetSourceEdge( " << edge << " )";
}

Here is the call graph for this function:

void StdMeshers_ProjectionSource1D_i::SetSourceMesh ( SMESH::SMESH_Mesh_ptr  mesh) throw ( SALOME::SALOME_Exception )

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

Definition at line 130 of file StdMeshers_ProjectionSource1D_i.cxx.

{
  ASSERT( myBaseImpl );

  ::SMESH_Mesh* mesh = 0;

  if ( !CORBA::is_nil( theMesh ))
  {
    SMESH_Mesh_i* mesh_i = SMESH::DownCast< SMESH_Mesh_i* >( theMesh );
    if ( !mesh_i )
      THROW_SALOME_CORBA_EXCEPTION( "bad mesh", SALOME::BAD_PARAM );
    mesh = &mesh_i->GetImpl();
  }

  try {
    this->GetImpl()->SetSourceMesh ( mesh );
  }
  catch ( SALOME_Exception& S_ex ) {
    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
  }

  myCorbaMesh = SMESH::SMESH_Mesh::_duplicate( theMesh );

  // Update Python script
  SMESH::TPythonDump() << _this() << ".SetSourceMesh( " << theMesh << " )";
}
void StdMeshers_ProjectionSource1D_i::SetVertexAssociation ( GEOM::GEOM_Object_ptr  sourceVertex,
GEOM::GEOM_Object_ptr  targetVertex 
) throw ( SALOME::SALOME_Exception )

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

This parameter is optional

Definition at line 103 of file StdMeshers_ProjectionSource1D_i.cxx.

{
  ASSERT( myBaseImpl );
  try {
    TopoDS_Shape v1 = StdMeshers_ObjRefUlils::GeomObjectToShape( sourceVertex );
    TopoDS_Shape v2 = StdMeshers_ObjRefUlils::GeomObjectToShape( targetVertex );
    this->GetImpl()->SetVertexAssociation( v1, v2 );

    myShapeEntries[ SRC_VERTEX ] = StdMeshers_ObjRefUlils::GeomObjectToEntry( sourceVertex );
    myShapeEntries[ TGT_VERTEX ] = StdMeshers_ObjRefUlils::GeomObjectToEntry( targetVertex );
  }
  catch ( SALOME_Exception& S_ex ) {
    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
  }
  // Update Python script
  SMESH::TPythonDump() << _this() << ".SetVertexAssociation( "
                       << sourceVertex << ", " << targetVertex << " )";
}

Here is the call graph for this function:


Member Data Documentation

SMESH::SMESH_Mesh_var StdMeshers_ProjectionSource1D_i::myCorbaMesh [private]

Definition at line 119 of file StdMeshers_ProjectionSource1D_i.hxx.

Definition at line 118 of file StdMeshers_ProjectionSource1D_i.hxx.


The documentation for this class was generated from the following files: