HYDROData_ArtificialObject.h
HYDROData_Bathymetry.h
HYDROData_BSplineOperation.h
- HYDROData_Calculation.h
+ HYDROData_CalculationCase.h
HYDROData_Document.h
HYDROData_Entity.h
HYDROData_IAltitudeObject.h
HYDROData_ArtificialObject.cxx
HYDROData_Bathymetry.cxx
HYDROData_BSplineOperation.cxx
- HYDROData_Calculation.cxx
+ HYDROData_CalculationCase.cxx
HYDROData_Document.cxx
HYDROData_Entity.cxx
HYDROData_IAltitudeObject.cxx
+++ /dev/null
-
-#include "HYDROData_Calculation.h"
-
-#include "HYDROData_ArtificialObject.h"
-#include "HYDROData_Document.h"
-#include "HYDROData_Iterator.h"
-#include "HYDROData_NaturalObject.h"
-#include "HYDROData_SplitToZonesTool.h"
-#include "HYDROData_Region.h"
-#include "HYDROData_Tool.h"
-#include "HYDROData_Zone.h"
-
-#define PYTHON_CALCULATION_ID "KIND_CALCULATION"
-
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Calculation, HYDROData_Entity)
-IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Calculation, HYDROData_Entity)
-
-HYDROData_Calculation::HYDROData_Calculation()
-: HYDROData_Entity()
-{
-}
-
-HYDROData_Calculation::~HYDROData_Calculation()
-{
-}
-
-QStringList HYDROData_Calculation::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
-{
- QStringList aResList;
-
- Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this );
- if ( aDocument.IsNull() )
- return aResList;
-
- QString aDocName = aDocument->GetDocPyName();
- QString aCalculName = GetName();
-
- aResList << QString( "%1 = %2.CreateObject( %3 );" )
- .arg( aCalculName ).arg( aDocName ).arg( PYTHON_CALCULATION_ID );
- aResList << QString( "%1.SetName( \"%2\" );" )
- .arg( aCalculName ).arg( aCalculName );
- aResList << QString( "" );
-
- HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
- HYDROData_SequenceOfObjects::Iterator anIter( aGeomObjects );
- for ( ; anIter.More(); anIter.Next() )
- {
- Handle(HYDROData_Object) aRefGeomObj =
- Handle(HYDROData_Object)::DownCast( anIter.Value() );
- if ( !aRefGeomObj.IsNull() )
- setPythonReferenceObject( theTreatedObjects, aResList, aRefGeomObj, "AddGeometryObject" );
- }
- aResList << QString( "" );
-
- aResList << QString( "%1.SplitGeometryObjects();" ).arg( aCalculName );
- aResList << QString( "" );
-
- // Now we restore the regions and zones order
- HYDROData_SequenceOfObjects aRegions = GetRegions();
- anIter.Init( aRegions );
- for ( ; anIter.More(); anIter.Next() )
- {
- Handle(HYDROData_Region) aRegion =
- Handle(HYDROData_Region)::DownCast( anIter.Value() );
- if ( aRegion.IsNull() )
- continue;
-
- QString aRegionName = aRegion->GetName();
- // TODO
- }
-
- return aResList;
-}
-
-void HYDROData_Calculation::SplitGeometryObjects()
-{
- // At first we remove previously created regions
- RemoveRegions();
-
- Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this );
- if ( aDocument.IsNull() )
- return;
-
- HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
- if ( aGeomObjects.IsEmpty() )
- return;
-
- HYDROData_SplitToZonesTool::SplitDataList aSplitedZones =
- HYDROData_SplitToZonesTool::SplitToZones( aGeomObjects );
- if ( aSplitedZones.isEmpty() )
- return;
-
- // Create result regions for case, by default one zone for one region
- HYDROData_SplitToZonesTool::SplitDataListIterator anIter( aSplitedZones );
- while( anIter.hasNext() )
- {
- const HYDROData_SplitToZonesTool::SplitData& aSplitData = anIter.next();
-
- // Create new region
- Handle(HYDROData_Region) aRegion = addNewRegion();
-
- QString aRegionName = HYDROData_Tool::GenerateObjectName( aDocument, "Region" );
- aRegion->SetName( aRegionName );
-
- // Add the zone for region
- Handle(HYDROData_Zone) aRegionZone = aRegion->addNewZone();
-
- QString aZoneName = HYDROData_Tool::GenerateObjectName( aDocument, "Zone" );
- aRegionZone->SetName( aZoneName );
-
- aRegionZone->SetShape( aSplitData.Face() );
-
- // Add the reference object for zone
- for ( int i = 0, n = aSplitData.ObjectNames.length(); i < n; ++i )
- {
- const QString& anObjName = aSplitData.ObjectNames.at( i );
-
- Handle(HYDROData_Object) aRefObject = Handle(HYDROData_Object)::DownCast(
- HYDROData_Tool::FindObjectByName( aDocument, anObjName ) );
- if ( aRefObject.IsNull() )
- continue;
-
- aRegionZone->AddGeometryObject( aRefObject );
- }
- }
-}
-
-bool HYDROData_Calculation::AddGeometryObject( const Handle(HYDROData_Object)& theObject )
-{
- if ( theObject.IsNull() )
- return false;
-
- if ( !theObject->IsKind( STANDARD_TYPE(HYDROData_ArtificialObject) ) &&
- !theObject->IsKind( STANDARD_TYPE(HYDROData_NaturalObject) ) )
- return false; // Wrong type of object
-
- if ( HasReference( theObject, DataTag_GeometryObject ) )
- return false; // Object is already in reference list
-
- AddReferenceObject( theObject, DataTag_GeometryObject );
- return true;
-}
-
-HYDROData_SequenceOfObjects HYDROData_Calculation::GetGeometryObjects() const
-{
- return GetReferenceObjects( DataTag_GeometryObject );
-}
-
-void HYDROData_Calculation::RemoveGeometryObject( const Handle(HYDROData_Object)& theObject )
-{
- if ( theObject.IsNull() )
- return;
-
- RemoveReferenceObject( theObject->Label(), DataTag_GeometryObject );
-}
-
-void HYDROData_Calculation::RemoveGeometryObjects()
-{
- ClearReferenceObjects( DataTag_GeometryObject );
-}
-
-Handle(HYDROData_Region) HYDROData_Calculation::AddNewRegion( const Handle(HYDROData_Zone)& theZone )
-{
- Handle(HYDROData_Region) aNewRegion = addNewRegion();
- if ( aNewRegion.IsNull() )
- return aNewRegion;
-
- // Generate new name for new region
- Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this );
- if ( !aDocument.IsNull() )
- {
- QString aNewRegionName = HYDROData_Tool::GenerateObjectName( aDocument, "Region" );
- aNewRegion->SetName( aNewRegionName );
- }
-
- aNewRegion->AddZone( theZone );
-
- return aNewRegion;
-}
-
-bool HYDROData_Calculation::AddRegion( const Handle(HYDROData_Region)& theRegion )
-{
- if ( theRegion.IsNull() )
- return false;
-
- if ( HasReference( theRegion, DataTag_Region ) )
- return false; // Object is already in reference list
-
- // Move the region from other calculation
- Handle(HYDROData_Calculation) aFatherCalc =
- Handle(HYDROData_Calculation)::DownCast( theRegion->GetFatherObject() );
- if ( !aFatherCalc.IsNull() && aFatherCalc->Label() != myLab )
- {
- Handle(HYDROData_Region) aNewRegion = addNewRegion();
- theRegion->CopyTo( aNewRegion );
-
- aFatherCalc->RemoveRegion( theRegion );
-
- theRegion->SetLabel( aNewRegion->Label() );
- }
-
- AddReferenceObject( theRegion, DataTag_Region );
- return true;
-}
-
-HYDROData_SequenceOfObjects HYDROData_Calculation::GetRegions() const
-{
- return GetReferenceObjects( DataTag_Region );
-}
-
-void HYDROData_Calculation::RemoveRegion( const Handle(HYDROData_Region)& theRegion )
-{
- if ( theRegion.IsNull() )
- return;
-
- RemoveReferenceObject( theRegion->Label(), DataTag_Region );
-
- // Remove region from data model
- Handle(HYDROData_Calculation) aFatherCalc =
- Handle(HYDROData_Calculation)::DownCast( theRegion->GetFatherObject() );
- if ( !aFatherCalc.IsNull() && aFatherCalc->Label() == myLab )
- theRegion->Remove();
-}
-
-void HYDROData_Calculation::RemoveRegions()
-{
- ClearReferenceObjects( DataTag_Region );
- myLab.FindChild( ChildTag_Region ).ForgetAllAttributes( true );
-}
-
-Handle(HYDROData_Region) HYDROData_Calculation::addNewRegion()
-{
- TDF_Label aNewLab = myLab.FindChild( ChildTag_Region ).NewChild();
-
- Handle(HYDROData_Region) aNewRegion =
- Handle(HYDROData_Region)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_REGION ) );
- AddRegion( aNewRegion );
-
- return aNewRegion;
-}
-
+++ /dev/null
-
-
-#ifndef HYDROData_Calculation_HeaderFile
-#define HYDROData_Calculation_HeaderFile
-
-#include <HYDROData_Entity.h>
-
-class Handle(HYDROData_Object);
-class Handle(HYDROData_Region);
-class Handle(HYDROData_Zone);
-
-DEFINE_STANDARD_HANDLE(HYDROData_Calculation, HYDROData_Entity)
-
-
-/**\class HYDROData_Calculation
- * \brief Calculation case is defined by selection of Geometry objects with or without \93Zone of water\94.
- *
- */
-class HYDROData_Calculation : public HYDROData_Entity
-{
-
-protected:
-
- /**
- * Enumeration of tags corresponding to the persistent object parameters.
- */
- enum DataTag
- {
- DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
- DataTag_GeometryObject, ///< reference geometry objects
- DataTag_Region ///< reference regions
- };
-
- /**
- * Enumeration of tags corresponding to the child sub-objects of object.
- */
- enum ChildTag
- {
- ChildTag_First = HYDROData_Entity::ChildTag_First + 100, ///< first tag, to reserve
- ChildTag_Region ///< child regions
- };
-
-public:
-
- DEFINE_STANDARD_RTTI(HYDROData_Calculation);
-
- /**
- * Returns the kind of this object. Must be redefined in all objects of known type.
- */
- HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_CALCULATION; }
-
-
- /**
- * Dump Calculation object to Python script representation.
- */
- HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
-
-public:
- // Public methods to work with Calculation
-
- /**
- * Split reference geometry objects to non-intersected regions.
- */
- HYDRODATA_EXPORT virtual void SplitGeometryObjects();
-
-
- /**
- * Add new one reference geometry object for calculation case.
- */
- HYDRODATA_EXPORT virtual bool AddGeometryObject( const Handle(HYDROData_Object)& theObject );
-
- /**
- * Returns all reference geometry objects of calculation case.
- */
- HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryObjects() const;
-
- /**
- * Removes reference geometry object from calculation case.
- */
- HYDRODATA_EXPORT virtual void RemoveGeometryObject( const Handle(HYDROData_Object)& theObject );
-
- /**
- * Removes all reference geometry objects from calculation case.
- */
- HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
-
-
- /**
- * Add new one child region for calculation case.
- * The new region is added into the list of reference regions.
- * The label of theZone is changed during this operation
- * because of new region becomes the new parent for this zone.
- */
- HYDRODATA_EXPORT virtual Handle(HYDROData_Region) AddNewRegion( const Handle(HYDROData_Zone)& theZone );
-
-
- /**
- * Add new one reference region for calculation case.
- * The label of theRegion is changed in case if old parent is not this calculation.
- */
- HYDRODATA_EXPORT virtual bool AddRegion( const Handle(HYDROData_Region)& theRegion );
-
- /**
- * Returns all reference regions of calculation case.
- */
- HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetRegions() const;
-
- /**
- * Removes reference region from calculation case.
- */
- HYDRODATA_EXPORT virtual void RemoveRegion( const Handle(HYDROData_Region)& theRegion );
-
- /**
- * Removes all reference regions from calculation case.
- */
- HYDRODATA_EXPORT virtual void RemoveRegions();
-
-private:
-
- /**
- * Add new one region for calculation case.
- * The new region is added into the list of reference regions.
- */
- HYDRODATA_EXPORT virtual Handle(HYDROData_Region) addNewRegion();
-
-
-protected:
-
- friend class HYDROData_Iterator;
-
- /**
- * Creates new object in the internal data structure. Use higher level objects
- * to create objects with real content.
- */
- HYDROData_Calculation();
-
- /**
- * Destructs properties of the object and object itself, removes it from the document.
- */
- ~HYDROData_Calculation();
-};
-
-#endif
--- /dev/null
+
+#include "HYDROData_CalculationCase.h"
+
+#include "HYDROData_ArtificialObject.h"
+#include "HYDROData_Document.h"
+#include "HYDROData_Iterator.h"
+#include "HYDROData_NaturalObject.h"
+#include "HYDROData_SplitToZonesTool.h"
+#include "HYDROData_Region.h"
+#include "HYDROData_Tool.h"
+#include "HYDROData_Zone.h"
+
+#define PYTHON_CALCULATION_ID "KIND_CALCULATION"
+
+IMPLEMENT_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
+IMPLEMENT_STANDARD_RTTIEXT(HYDROData_CalculationCase, HYDROData_Entity)
+
+HYDROData_CalculationCase::HYDROData_CalculationCase()
+: HYDROData_Entity()
+{
+}
+
+HYDROData_CalculationCase::~HYDROData_CalculationCase()
+{
+}
+
+QStringList HYDROData_CalculationCase::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
+{
+ QStringList aResList;
+
+ Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this );
+ if ( aDocument.IsNull() )
+ return aResList;
+
+ QString aDocName = aDocument->GetDocPyName();
+ QString aCalculName = GetName();
+
+ aResList << QString( "%1 = %2.CreateObject( %3 );" )
+ .arg( aCalculName ).arg( aDocName ).arg( PYTHON_CALCULATION_ID );
+ aResList << QString( "%1.SetName( \"%2\" );" )
+ .arg( aCalculName ).arg( aCalculName );
+ aResList << QString( "" );
+
+ HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
+ HYDROData_SequenceOfObjects::Iterator anIter( aGeomObjects );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ Handle(HYDROData_Object) aRefGeomObj =
+ Handle(HYDROData_Object)::DownCast( anIter.Value() );
+ if ( !aRefGeomObj.IsNull() )
+ setPythonReferenceObject( theTreatedObjects, aResList, aRefGeomObj, "AddGeometryObject" );
+ }
+ aResList << QString( "" );
+
+ aResList << QString( "%1.SplitGeometryObjects();" ).arg( aCalculName );
+ aResList << QString( "" );
+
+ // Now we restore the regions and zones order
+ HYDROData_SequenceOfObjects aRegions = GetRegions();
+ anIter.Init( aRegions );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ Handle(HYDROData_Region) aRegion =
+ Handle(HYDROData_Region)::DownCast( anIter.Value() );
+ if ( aRegion.IsNull() )
+ continue;
+
+ QString aRegionName = aRegion->GetName();
+ // TODO
+ }
+
+ return aResList;
+}
+
+void HYDROData_CalculationCase::SplitGeometryObjects()
+{
+ // At first we remove previously created regions
+ RemoveRegions();
+
+ Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this );
+ if ( aDocument.IsNull() )
+ return;
+
+ HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
+ if ( aGeomObjects.IsEmpty() )
+ return;
+
+ HYDROData_SplitToZonesTool::SplitDataList aSplitedZones =
+ HYDROData_SplitToZonesTool::SplitToZones( aGeomObjects );
+ if ( aSplitedZones.isEmpty() )
+ return;
+
+ // Create result regions for case, by default one zone for one region
+ HYDROData_SplitToZonesTool::SplitDataListIterator anIter( aSplitedZones );
+ while( anIter.hasNext() )
+ {
+ const HYDROData_SplitToZonesTool::SplitData& aSplitData = anIter.next();
+
+ // Create new region
+ Handle(HYDROData_Region) aRegion = addNewRegion();
+
+ QString aRegionName = HYDROData_Tool::GenerateObjectName( aDocument, "Region" );
+ aRegion->SetName( aRegionName );
+
+ // Add the zone for region
+ Handle(HYDROData_Zone) aRegionZone = aRegion->addNewZone();
+
+ QString aZoneName = HYDROData_Tool::GenerateObjectName( aDocument, "Zone" );
+ aRegionZone->SetName( aZoneName );
+
+ aRegionZone->SetShape( aSplitData.Face() );
+
+ // Add the reference object for zone
+ for ( int i = 0, n = aSplitData.ObjectNames.length(); i < n; ++i )
+ {
+ const QString& anObjName = aSplitData.ObjectNames.at( i );
+
+ Handle(HYDROData_Object) aRefObject = Handle(HYDROData_Object)::DownCast(
+ HYDROData_Tool::FindObjectByName( aDocument, anObjName ) );
+ if ( aRefObject.IsNull() )
+ continue;
+
+ aRegionZone->AddGeometryObject( aRefObject );
+ }
+ }
+}
+
+bool HYDROData_CalculationCase::AddGeometryObject( const Handle(HYDROData_Object)& theObject )
+{
+ if ( theObject.IsNull() )
+ return false;
+
+ if ( !theObject->IsKind( STANDARD_TYPE(HYDROData_ArtificialObject) ) &&
+ !theObject->IsKind( STANDARD_TYPE(HYDROData_NaturalObject) ) )
+ return false; // Wrong type of object
+
+ if ( HasReference( theObject, DataTag_GeometryObject ) )
+ return false; // Object is already in reference list
+
+ AddReferenceObject( theObject, DataTag_GeometryObject );
+ return true;
+}
+
+HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetGeometryObjects() const
+{
+ return GetReferenceObjects( DataTag_GeometryObject );
+}
+
+void HYDROData_CalculationCase::RemoveGeometryObject( const Handle(HYDROData_Object)& theObject )
+{
+ if ( theObject.IsNull() )
+ return;
+
+ RemoveReferenceObject( theObject->Label(), DataTag_GeometryObject );
+}
+
+void HYDROData_CalculationCase::RemoveGeometryObjects()
+{
+ ClearReferenceObjects( DataTag_GeometryObject );
+}
+
+Handle(HYDROData_Region) HYDROData_CalculationCase::AddNewRegion( const Handle(HYDROData_Zone)& theZone )
+{
+ Handle(HYDROData_Region) aNewRegion = addNewRegion();
+ if ( aNewRegion.IsNull() )
+ return aNewRegion;
+
+ // Generate new name for new region
+ Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this );
+ if ( !aDocument.IsNull() )
+ {
+ QString aNewRegionName = HYDROData_Tool::GenerateObjectName( aDocument, "Region" );
+ aNewRegion->SetName( aNewRegionName );
+ }
+
+ aNewRegion->AddZone( theZone );
+
+ return aNewRegion;
+}
+
+bool HYDROData_CalculationCase::AddRegion( const Handle(HYDROData_Region)& theRegion )
+{
+ if ( theRegion.IsNull() )
+ return false;
+
+ if ( HasReference( theRegion, DataTag_Region ) )
+ return false; // Object is already in reference list
+
+ // Move the region from other calculation
+ Handle(HYDROData_CalculationCase) aFatherCalc =
+ Handle(HYDROData_CalculationCase)::DownCast( theRegion->GetFatherObject() );
+ if ( !aFatherCalc.IsNull() && aFatherCalc->Label() != myLab )
+ {
+ Handle(HYDROData_Region) aNewRegion = addNewRegion();
+ theRegion->CopyTo( aNewRegion );
+
+ aFatherCalc->RemoveRegion( theRegion );
+
+ theRegion->SetLabel( aNewRegion->Label() );
+ }
+
+ AddReferenceObject( theRegion, DataTag_Region );
+ return true;
+}
+
+HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetRegions() const
+{
+ return GetReferenceObjects( DataTag_Region );
+}
+
+void HYDROData_CalculationCase::RemoveRegion( const Handle(HYDROData_Region)& theRegion )
+{
+ if ( theRegion.IsNull() )
+ return;
+
+ RemoveReferenceObject( theRegion->Label(), DataTag_Region );
+
+ // Remove region from data model
+ Handle(HYDROData_CalculationCase) aFatherCalc =
+ Handle(HYDROData_CalculationCase)::DownCast( theRegion->GetFatherObject() );
+ if ( !aFatherCalc.IsNull() && aFatherCalc->Label() == myLab )
+ theRegion->Remove();
+}
+
+void HYDROData_CalculationCase::RemoveRegions()
+{
+ ClearReferenceObjects( DataTag_Region );
+ myLab.FindChild( ChildTag_Region ).ForgetAllAttributes( true );
+}
+
+Handle(HYDROData_Region) HYDROData_CalculationCase::addNewRegion()
+{
+ TDF_Label aNewLab = myLab.FindChild( ChildTag_Region ).NewChild();
+
+ Handle(HYDROData_Region) aNewRegion =
+ Handle(HYDROData_Region)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_REGION ) );
+ AddRegion( aNewRegion );
+
+ return aNewRegion;
+}
+
--- /dev/null
+
+
+#ifndef HYDROData_CalculationCase_HeaderFile
+#define HYDROData_CalculationCase_HeaderFile
+
+#include <HYDROData_Entity.h>
+
+class Handle(HYDROData_Object);
+class Handle(HYDROData_Region);
+class Handle(HYDROData_Zone);
+
+DEFINE_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
+
+
+/**\class HYDROData_CalculationCase
+ * \brief Calculation case is defined by selection of Geometry objects with or without \93Zone of water\94.
+ *
+ */
+class HYDROData_CalculationCase : public HYDROData_Entity
+{
+
+protected:
+
+ /**
+ * Enumeration of tags corresponding to the persistent object parameters.
+ */
+ enum DataTag
+ {
+ DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
+ DataTag_GeometryObject, ///< reference geometry objects
+ DataTag_Region ///< reference regions
+ };
+
+ /**
+ * Enumeration of tags corresponding to the child sub-objects of object.
+ */
+ enum ChildTag
+ {
+ ChildTag_First = HYDROData_Entity::ChildTag_First + 100, ///< first tag, to reserve
+ ChildTag_Region ///< child regions
+ };
+
+public:
+
+ DEFINE_STANDARD_RTTI(HYDROData_CalculationCase);
+
+ /**
+ * Returns the kind of this object. Must be redefined in all objects of known type.
+ */
+ HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_CALCULATION; }
+
+
+ /**
+ * Dump Calculation object to Python script representation.
+ */
+ HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
+
+public:
+ // Public methods to work with Calculation
+
+ /**
+ * Split reference geometry objects to non-intersected regions.
+ */
+ HYDRODATA_EXPORT virtual void SplitGeometryObjects();
+
+
+ /**
+ * Add new one reference geometry object for calculation case.
+ */
+ HYDRODATA_EXPORT virtual bool AddGeometryObject( const Handle(HYDROData_Object)& theObject );
+
+ /**
+ * Returns all reference geometry objects of calculation case.
+ */
+ HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryObjects() const;
+
+ /**
+ * Removes reference geometry object from calculation case.
+ */
+ HYDRODATA_EXPORT virtual void RemoveGeometryObject( const Handle(HYDROData_Object)& theObject );
+
+ /**
+ * Removes all reference geometry objects from calculation case.
+ */
+ HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
+
+
+ /**
+ * Add new one child region for calculation case.
+ * The new region is added into the list of reference regions.
+ * The label of theZone is changed during this operation
+ * because of new region becomes the new parent for this zone.
+ */
+ HYDRODATA_EXPORT virtual Handle(HYDROData_Region) AddNewRegion( const Handle(HYDROData_Zone)& theZone );
+
+
+ /**
+ * Add new one reference region for calculation case.
+ * The label of theRegion is changed in case if old parent is not this calculation.
+ */
+ HYDRODATA_EXPORT virtual bool AddRegion( const Handle(HYDROData_Region)& theRegion );
+
+ /**
+ * Returns all reference regions of calculation case.
+ */
+ HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetRegions() const;
+
+ /**
+ * Removes reference region from calculation case.
+ */
+ HYDRODATA_EXPORT virtual void RemoveRegion( const Handle(HYDROData_Region)& theRegion );
+
+ /**
+ * Removes all reference regions from calculation case.
+ */
+ HYDRODATA_EXPORT virtual void RemoveRegions();
+
+private:
+
+ /**
+ * Add new one region for calculation case.
+ * The new region is added into the list of reference regions.
+ */
+ HYDRODATA_EXPORT virtual Handle(HYDROData_Region) addNewRegion();
+
+
+protected:
+
+ friend class HYDROData_Iterator;
+
+ /**
+ * Creates new object in the internal data structure. Use higher level objects
+ * to create objects with real content.
+ */
+ HYDROData_CalculationCase();
+
+ /**
+ * Destructs properties of the object and object itself, removes it from the document.
+ */
+ ~HYDROData_CalculationCase();
+};
+
+#endif
#include "HYDROData_AltitudeObject.h"
#include "HYDROData_Bathymetry.h"
-#include "HYDROData_Calculation.h"
+#include "HYDROData_CalculationCase.h"
#include "HYDROData_Image.h"
#include "HYDROData_ImmersibleZone.h"
#include "HYDROData_Polyline.h"
aResult = new HYDROData_ImmersibleZone();
break;
case KIND_CALCULATION:
- aResult = new HYDROData_Calculation();
+ aResult = new HYDROData_CalculationCase();
break;
case KIND_REGION:
aResult = new HYDROData_Region();
protected:
- friend class HYDROData_Calculation;
+ friend class HYDROData_CalculationCase;
friend class HYDROData_Iterator;
/**
return aResList;
}
-void HYDROGUI_CalculationDlg::setEditedObject( const Handle(HYDROData_Calculation) theCase )
+void HYDROGUI_CalculationDlg::setEditedObject( const Handle(HYDROData_CalculationCase) theCase )
{
myEditedObject = theCase;
#define HYDROGUI_CALCULATIONDLG_H
#include "HYDROGUI_Wizard.h"
-#include <HYDROData_Calculation.h>
+#include <HYDROData_CalculationCase.h>
class HYDROGUI_ObjSelector;
class QGroupBox;
void setObjectName( const QString& theName );
QString getObjectName() const;
- void setEditedObject( const Handle(HYDROData_Calculation) theCase );
+ void setEditedObject( const Handle(HYDROData_CalculationCase) theCase );
void setGeomObjects( const QStringList& theObjects );
void setSelectedGeomObjects( const QStringList& theObjects );
QListWidget* myGeomObjects;
HYDROGUI_DataBrowser* myBrowser;
- Handle(HYDROData_Calculation) myEditedObject;
+ Handle(HYDROData_CalculationCase) myEditedObject;
QComboBox* myBathymetryChoice;
};
myEditedObject.Nullify();
if ( myIsEdit )
{
- myEditedObject = Handle(HYDROData_Calculation)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
+ myEditedObject = Handle(HYDROData_CalculationCase)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
if ( !myEditedObject.IsNull() )
{
anObjectName = myEditedObject->GetName();
else
{
myEditedObject =
- Handle(HYDROData_Calculation)::DownCast( doc()->CreateObject( KIND_CALCULATION ) );
+ Handle(HYDROData_CalculationCase)::DownCast( doc()->CreateObject( KIND_CALCULATION ) );
myEditedObject->SetName(anObjectName);
}
//Handle(HYDROData_Document) aDocument = doc();
- //Handle(HYDROData_Calculation) aCalculObj = myIsEdit ? myEditedObject :
- // Handle(HYDROData_Calculation)::DownCast( aDocument->CreateObject( KIND_CALCULATION ) );
+ //Handle(HYDROData_CalculationCase) aCalculObj = myIsEdit ? myEditedObject :
+ // Handle(HYDROData_CalculationCase)::DownCast( aDocument->CreateObject( KIND_CALCULATION ) );
//if ( aCalculObj.IsNull() )
// return false;
#include "HYDROData_SplitToZonesTool.h"
#include "HYDROGUI_Shape.h"
-#include <HYDROData_Calculation.h>
+#include <HYDROData_CalculationCase.h>
#include <HYDROData_Region.h>
class SUIT_ViewManager;
private:
bool myIsEdit;
- Handle(HYDROData_Calculation) myEditedObject;
+ Handle(HYDROData_CalculationCase) myEditedObject;
SUIT_ViewManager* myActiveViewManager;
#include "HYDROGUI_Tool.h"
#include <HYDROData_Bathymetry.h>
-#include <HYDROData_Calculation.h>
+#include <HYDROData_CalculationCase.h>
#include <HYDROData_Document.h>
#include <HYDROData_Image.h>
#include <HYDROData_ImmersibleZone.h>
anIterator = HYDROData_Iterator( aDocument, KIND_CALCULATION );
for( ; anIterator.More(); anIterator.Next() )
{
- Handle(HYDROData_Calculation) aCalculObj =
- Handle(HYDROData_Calculation)::DownCast( anIterator.Current() );
+ Handle(HYDROData_CalculationCase) aCalculObj =
+ Handle(HYDROData_CalculationCase)::DownCast( anIterator.Current() );
if( !aCalculObj.IsNull() )
createObject( aCalculRootObj, aCalculObj );
}
}
else if ( anObjectKind == KIND_CALCULATION )
{
- Handle(HYDROData_Calculation) aCaseObj =
- Handle(HYDROData_Calculation)::DownCast( aDataObj );
+ Handle(HYDROData_CalculationCase) aCaseObj =
+ Handle(HYDROData_CalculationCase)::DownCast( aDataObj );
LightApp_DataObject* aCaseRegionsSect =
createObject( aGuiObj, tr( "CASE_REGIONS" ), aGuiObj->entry() );