// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "HYDROData_Entity.h"
-
-#include "HYDROData_Iterator.h"
-#include "HYDROData_Tool.h"
-
+#include <HYDROData_Entity.h>
+#include <HYDROData_Document.h>
+#include <HYDROData_Iterator.h>
+#include <HYDROData_Tool.h>
+#include <Standard_GUID.hxx>
#include <TDataStd_Name.hxx>
#include <TDataStd_ByteArray.hxx>
#include <TDataStd_UAttribute.hxx>
-#include <TDataStd_IntegerArray.hxx>
-#include <TDataStd_BooleanArray.hxx>
#include <TDataStd_Integer.hxx>
-#include <TDataStd_RealArray.hxx>
+#include <TDataStd_IntegerArray.hxx>
#include <TDataStd_ReferenceList.hxx>
-
#include <TDF_CopyLabel.hxx>
#include <TDF_ListIteratorOfLabelList.hxx>
-
+#include <TNaming_Builder.hxx>
+#include <TNaming_NamedShape.hxx>
+#include <TopoDS_Shape.hxx>
#include <QColor>
-#include <QString>
+#include <QRegExp>
#include <QStringList>
#include <QVariant>
+HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects()
+ : NCollection_Sequence<Handle_HYDROData_Entity>()
+{
+}
+
+HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects( const HYDROData_SequenceOfObjects& theSequence )
+ : NCollection_Sequence<Handle_HYDROData_Entity>( theSequence )
+{
+}
+
+HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects( const NCollection_Sequence<Handle_HYDROData_Entity>& theSequence )
+ : NCollection_Sequence<Handle_HYDROData_Entity>( theSequence )
+{
+}
+
+
IMPLEMENT_STANDARD_HANDLE(HYDROData_Entity,MMgt_TShared)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Entity,MMgt_TShared)
TDataStd_Name::Set(myLab, TCollection_ExtendedString(theName.toLatin1().constData()));
}
-QStringList HYDROData_Entity::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
+QStringList HYDROData_Entity::DumpToPython( const QString& thePyScriptPath,
+ MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList anEmptyList;
return anEmptyList;
if ( !aGeomChangeAttr.IsNull() )
aGeomChangeFlag = aGeomChangeAttr->Get();
- if( ( myGeom & theChangedGeometry ) == 0 )
+ int aBitsToChange = ( myGeom & theChangedGeometry );
+ if( aBitsToChange == 0 )
return;
- aGeomChangeFlag = ( aGeomChangeFlag | theChangedGeometry );
+ aGeomChangeFlag = ( aGeomChangeFlag | aBitsToChange );
TDataStd_Integer::Set( aGeomChangeLab, aGeomChangeFlag );
HYDROData_Iterator anIter( aDocument );
for ( ; anIter.More(); anIter.Next() )
{
Handle(HYDROData_Entity) anObject = anIter.Current();
+ if( anObject.IsNull() )
+ continue;
HYDROData_SequenceOfObjects aRefSeq = anObject->GetAllReferenceObjects();
for ( int i = 1, n = aRefSeq.Length(); i <= n; ++i )
{
Handle(HYDROData_Entity) aRefObject = aRefSeq.Value( i );
if( aRefObject->Label()==myLab )
- Changed( theChangedGeometry );
+ anObject->Changed( theChangedGeometry );
}
}
}
case KIND_STREAM_ALTITUDE: return "KIND_STREAM_ALTITUDE";
case KIND_OBSTACLE_ALTITUDE: return "KIND_OBSTACLE_ALTITUDE";
case KIND_STRICKLER_TABLE: return "KIND_STRICKLER_TABLE";
- case KIND_LAND_COVER: return "KIND_LAND_COVER";
+ case KIND_LAND_COVER_OBSOLETE: return "";
+ case KIND_LAND_COVER_MAP: return "KIND_LAND_COVER_MAP";
default: return "KIND_UNKNOWN"; ///! Unrecognized object
}
}
-void HYDROData_Entity::setPythonReferenceObject( MapOfTreatedObjects& theTreatedObjects,
+void HYDROData_Entity::setPythonReferenceObject( const QString& thePyScriptPath,
+ MapOfTreatedObjects& theTreatedObjects,
QStringList& theScript,
const Handle(HYDROData_Entity)& theRefObject,
const QString& theMethod ) const
{
- if ( !checkObjectPythonDefinition( theTreatedObjects, theScript, theRefObject ) )
+ if ( !checkObjectPythonDefinition( thePyScriptPath, theTreatedObjects, theScript, theRefObject ) )
return;
QString aRefObjName = theRefObject->GetObjPyName();
.arg( anObjName ).arg( theMethod ).arg( aRefObjName );
}
-bool HYDROData_Entity::checkObjectPythonDefinition( MapOfTreatedObjects& theTreatedObjects,
+bool HYDROData_Entity::checkObjectPythonDefinition( const QString& thePyScriptPath,
+ MapOfTreatedObjects& theTreatedObjects,
QStringList& theScript,
const Handle(HYDROData_Entity)& theRefObject ) const
{
return true;
// The definition of reference object must be dumped before this
- QStringList aRefObjDump = theRefObject->DumpToPython( theTreatedObjects );
+ QStringList aRefObjDump = theRefObject->DumpToPython( thePyScriptPath, theTreatedObjects );
if ( aRefObjDump.isEmpty() )
return false;
.arg( aDocument->GetDocPyName() )
.arg( GetName() );
}
+
+void HYDROData_Entity::SetShape( int theTag, const TopoDS_Shape& theShape )
+{
+ TNaming_Builder aBuilder( myLab.FindChild( theTag ) );
+ aBuilder.Generated( theShape );
+}
+
+TopoDS_Shape HYDROData_Entity::GetShape( int theTag ) const
+{
+ TDF_Label aShapeLabel = myLab.FindChild( theTag, false );
+ if ( !aShapeLabel.IsNull() )
+ {
+ Handle(TNaming_NamedShape) aNamedShape;
+ if ( aShapeLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) )
+ return aNamedShape->Get();
+ }
+ return TopoDS_Shape();
+}