mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-18 09:50:36 +05:00
0021347: [CEA 497] Visualisation into SMESH and VISU of hexagonal prism cells (MED_OCTA12)
0021380: EDF 1937 SMESH: Take into account QUAD9 and HEXA27 + prepare to 0021439: Dump of study gives bad geom group and stops with NameError exception
This commit is contained in:
parent
faf45035fc
commit
5638e6783f
@ -258,6 +258,8 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
|
||||
map< _pyID, Handle(_pyMesh) >::iterator id_mesh = myMeshes.find( objID );
|
||||
if ( id_mesh != myMeshes.end() )
|
||||
{
|
||||
id_mesh->second->AddProcessedCmd( aCommand );
|
||||
|
||||
// check for mesh editor object
|
||||
if ( aCommand->GetMethod() == "GetMeshEditor" ) { // MeshEditor creation
|
||||
_pyID editorID = aCommand->GetResultValue();
|
||||
@ -281,12 +283,15 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
|
||||
if ( id_editor != myMeshEditors.end() )
|
||||
{
|
||||
id_editor->second->Process( aCommand );
|
||||
id_editor->second->AddProcessedCmd( aCommand );
|
||||
TCollection_AsciiString processedCommand = aCommand->GetString();
|
||||
|
||||
// some commands of SMESH_MeshEditor create meshes
|
||||
if ( aCommand->GetMethod().Search("MakeMesh") != -1 ) {
|
||||
Handle(_pyMesh) mesh = new _pyMesh( aCommand, aCommand->GetResultValue() );
|
||||
_pyID meshID = aCommand->GetResultValue();
|
||||
Handle(_pyMesh) mesh = new _pyMesh( aCommand, meshID );
|
||||
aCommand->GetString() = processedCommand; // discard changes made by _pyMesh
|
||||
myMeshes.insert( make_pair( mesh->GetID(), mesh ));
|
||||
myMeshes.insert( make_pair( meshID, mesh ));
|
||||
}
|
||||
if ( aCommand->GetMethod() == "MakeBoundaryMesh") {
|
||||
_pyID meshID = aCommand->GetResultValue(0);
|
||||
@ -304,6 +309,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
|
||||
for ( ; hyp != myHypos.end(); ++hyp )
|
||||
if ( !(*hyp)->IsAlgo() && objID == (*hyp)->GetID() ) {
|
||||
(*hyp)->Process( aCommand );
|
||||
(*hyp)->AddProcessedCmd( aCommand );
|
||||
return aCommand;
|
||||
}
|
||||
|
||||
@ -325,6 +331,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
|
||||
map< _pyID, Handle(_pyObject) >::iterator id_obj = myObjects.find( objID );
|
||||
if ( id_obj != myObjects.end() ) {
|
||||
id_obj->second->Process( aCommand );
|
||||
id_obj->second->AddProcessedCmd( aCommand );
|
||||
return aCommand;
|
||||
}
|
||||
|
||||
@ -389,7 +396,8 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
|
||||
// set SMESH.GeometryType instead of a numerical Threshold
|
||||
const char* types[SMESH::Geom_POLYHEDRA+1] = {
|
||||
"Geom_POINT", "Geom_EDGE", "Geom_TRIANGLE", "Geom_QUADRANGLE", "Geom_POLYGON",
|
||||
"Geom_TETRA", "Geom_PYRAMID", "Geom_HEXA", "Geom_PENTA", "Geom_POLYHEDRA"
|
||||
"Geom_TETRA", "Geom_PYRAMID", "Geom_HEXA", "Geom_PENTA", "Geom_HEXAGONAL_PRISM",
|
||||
"Geom_POLYHEDRA"
|
||||
};
|
||||
int iGeom = Threshold.IntegerValue();
|
||||
if ( -1 < iGeom && iGeom < SMESH::Geom_POLYHEDRA+1 )
|
||||
@ -825,6 +833,18 @@ Handle(_pyObject) _pyGen::FindObject( const _pyID& theObjID ) const
|
||||
return ( id_obj == myObjects.end() ) ? Handle(_pyObject)() : id_obj->second;
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Returns true if an object is removed from study
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
bool _pyGen::IsDead(const _pyID& theObjID) const
|
||||
{
|
||||
const bool hasStudyName = myObjectNames.IsBound( theObjID );
|
||||
return !hasStudyName;
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Find out type of geom group
|
||||
@ -1190,7 +1210,7 @@ void _pyMesh::Flush()
|
||||
// try to convert
|
||||
if ( algo->Addition2Creation( addCmd, this->GetID() )) // OK
|
||||
{
|
||||
// wrapped algo is created atfer mesh creation
|
||||
// wrapped algo is created after mesh creation
|
||||
GetCreationCmd()->AddDependantCmd( addCmd );
|
||||
|
||||
if ( isLocalAlgo ) {
|
||||
@ -1683,6 +1703,24 @@ Handle(_pyHypothesis) _pyHypothesis::NewHypothesis( const Handle(_pyCommand)& th
|
||||
return algo->IsValid() ? algo : hyp;
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Returns true if addition of this hypothesis to a given mesh can be
|
||||
* wrapped into hypothesis creation
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
bool _pyHypothesis::IsWrappable(const _pyID& theMesh) const
|
||||
{
|
||||
if ( !myIsWrapped && myMesh == theMesh && !IsRemovedFromStudy() )
|
||||
{
|
||||
Handle(_pyObject) pyMesh = theGen->FindObject( myMesh );
|
||||
if ( !pyMesh.IsNull() && !pyMesh->IsRemovedFromStudy() )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Convert the command adding a hypothesis to mesh into a smesh command
|
||||
@ -1889,7 +1927,7 @@ void _pyComplexParamHypo::Process( const Handle(_pyCommand)& theCommand)
|
||||
|
||||
if( theCommand->GetMethod() == "SetLength" )
|
||||
{
|
||||
// NOW it becomes OBSOLETE
|
||||
// NOW it is OBSOLETE
|
||||
// ex: hyp.SetLength(start, 1)
|
||||
// hyp.SetLength(end, 0)
|
||||
ASSERT(( theCommand->GetArg( 2 ).IsIntegerValue() ));
|
||||
@ -2726,6 +2764,19 @@ bool _pyCommand::AddAccessorMethod( _pyID theObjectID, const char* theAcsMethod
|
||||
return added;
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Creates pyObject
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
_pyObject::_pyObject(const Handle(_pyCommand)& theCreationCmd)
|
||||
: myCreationCmd(theCreationCmd), myNbCalls(0), myIsRemoved(false)
|
||||
{
|
||||
if ( !theCreationCmd.IsNull() && !theCreationCmd->IsEmpty() )
|
||||
myIsRemoved = theGen->IsDead( theCreationCmd->GetResultValue() );
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Return method name giving access to an interaface object wrapped by python class
|
||||
|
@ -154,15 +154,19 @@ class _pyObject: public Standard_Transient
|
||||
{
|
||||
Handle(_pyCommand) myCreationCmd;
|
||||
int myNbCalls;
|
||||
bool myIsRemoved, myIsProtected;
|
||||
std::list< Handle(_pyCommand) > myProcessedCmds;
|
||||
public:
|
||||
_pyObject(const Handle(_pyCommand)& theCreationCmd)
|
||||
: myCreationCmd(theCreationCmd), myNbCalls(0) {}
|
||||
_pyObject(const Handle(_pyCommand)& theCreationCmd);
|
||||
const _pyID& GetID() { return myCreationCmd->GetResultValue(); }
|
||||
static _pyID FatherID(const _pyID & childID);
|
||||
const Handle(_pyCommand)& GetCreationCmd() { return myCreationCmd; }
|
||||
int GetNbCalls() const { return myNbCalls; }
|
||||
bool IsRemovedFromStudy() const { return myIsRemoved; }
|
||||
void SetCreationCmd( Handle(_pyCommand) cmd ) { myCreationCmd = cmd; }
|
||||
int GetCommandNb() { return myCreationCmd->GetOrderNb(); }
|
||||
void AddProcessedCmd( const Handle(_pyCommand) & cmd )
|
||||
{ if ( !cmd.IsNull() ) myProcessedCmds.push_back( cmd ); }
|
||||
virtual void Process(const Handle(_pyCommand) & theCommand) { myNbCalls++; }
|
||||
virtual void Flush() = 0;
|
||||
virtual const char* AccessorMethod() const;
|
||||
@ -200,6 +204,7 @@ public:
|
||||
_pyID GenerateNewID( const _pyID& theID );
|
||||
void AddObject( Handle(_pyObject)& theObj );
|
||||
Handle(_pyObject) FindObject( const _pyID& theObjID ) const;
|
||||
bool IsDead(const _pyID& theObjID) const;
|
||||
|
||||
private:
|
||||
void setNeighbourCommand( Handle(_pyCommand)& theCmd,
|
||||
@ -319,7 +324,7 @@ public:
|
||||
{ return myType2CreationMethod.find( algoType ) != myType2CreationMethod.end(); }
|
||||
const TCollection_AsciiString& GetCreationMethod(const TCollection_AsciiString& algoType) const
|
||||
{ return myType2CreationMethod.find( algoType )->second; }
|
||||
virtual bool IsWrappable(const _pyID& theMesh) { return !myIsWrapped && myMesh == theMesh; }
|
||||
virtual bool IsWrappable(const _pyID& theMesh) const;
|
||||
virtual bool Addition2Creation( const Handle(_pyCommand)& theAdditionCmd,
|
||||
const _pyID& theMesh);
|
||||
static Handle(_pyHypothesis) NewHypothesis( const Handle(_pyCommand)& theCreationCmd);
|
||||
|
Loading…
Reference in New Issue
Block a user