HYDROData.h
HYDROData_Application.h
HYDROData_Bathymetry.h
+ HYDROData_Calculation.h
HYDROData_Document.h
HYDROData_Lambert93.h
HYDROData_Image.h
set(PROJECT_SOURCES
HYDROData_Application.cxx
HYDROData_Bathymetry.cxx
+ HYDROData_Calculation.cxx
HYDROData_Document.cxx
HYDROData_Image.cxx
HYDROData_Iterator.cxx
test_HYDROData_Image.h
test_HYDROData_Polyline.h
test_HYDROData_Bathymetry.h
+ test_HYDROData_Calculation.h
test_HYDROOperations_BSpline.h
test_HYDROOperations_Factory.h
)
test_HYDROData_Image.cxx
test_HYDROData_Polyline.cxx
test_HYDROData_Bathymetry.cxx
+ test_HYDROData_Calculation.cxx
test_HYDROOperations_BSpline.cxx
test_HYDROOperations_Factory.cxx
)
RelativePath=".\HYDROData_Bathymetry.cxx"
>
</File>
+ <File
+ RelativePath=".\HYDROData_Calculation.cxx"
+ >
+ </File>
<File
RelativePath=".\HYDROData_Document.cxx"
>
RelativePath=".\HYDROData_Bathymetry.h"
>
</File>
+ <File
+ RelativePath=".\HYDROData_Calculation.h"
+ >
+ </File>
<File
RelativePath=".\HYDROData_Document.h"
>
--- /dev/null
+
+#include "HYDROData_Calculation.h"
+
+#include "HYDROData_Document.h"
+
+#include <QStringList>
+
+#define PYTHON_BATHYMETRY_ID "KIND_CALCULATION"
+
+IMPLEMENT_STANDARD_HANDLE(HYDROData_Calculation, HYDROData_Object)
+IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Calculation, HYDROData_Object)
+
+HYDROData_Calculation::HYDROData_Calculation()
+{
+}
+
+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_BATHYMETRY_ID );
+ aResList << QString( "%1.SetName( \"%2\" );" )
+ .arg( aCalculName ).arg( aCalculName );
+
+ // TO_IMPLEMENT
+
+ return aResList;
+}
--- /dev/null
+
+#ifndef HYDROData_HYDROData_Calculation
+#define HYDROData_HYDROData_Calculation
+
+#include <HYDROData_Object.h>
+
+class gp_XY;
+class gp_XYZ;
+class QPointF;
+class QFile;
+
+DEFINE_STANDARD_HANDLE(HYDROData_Calculation, HYDROData_Object)
+
+
+/**\class HYDROData_Calculation
+ * \brief Class that stores/retreives information about the Calculation case.
+ *
+ * Calculation case is defined by selection of Geometry objects with or without \93Zone of water\94.
+ */
+class HYDROData_Calculation : public HYDROData_Object
+{
+
+protected:
+
+ /**
+ * Enumeration of tags corresponding to the persistent object parameters.
+ */
+ enum DataTag
+ {
+ DataTag_First = HYDROData_Object::DataTag_First + 100, ///< first tag, to reserve
+ };
+
+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
+
+
+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
aRes = aRes && dumpPartitionToPython( aFile, aTreatedObjects, KIND_IMAGE );
aRes = aRes && dumpPartitionToPython( aFile, aTreatedObjects, KIND_POLYLINE );
aRes = aRes && dumpPartitionToPython( aFile, aTreatedObjects, KIND_BATHYMETRY );
+ aRes = aRes && dumpPartitionToPython( aFile, aTreatedObjects, KIND_CALCULATION );
return aRes;
}
#include <HYDROData_Polyline.h>
#include <HYDROData_VisualState.h>
#include <HYDROData_Bathymetry.h>
+#include <HYDROData_Calculation.h>
#include <TDataStd_Name.hxx>
#include <NCollection_DataMap.hxx>
return Object(aNewLab);
}
-Handle_HYDROData_Object HYDROData_Iterator::Object(const TDF_Label theLabel)
+Handle_HYDROData_Object HYDROData_Iterator::Object( const TDF_Label theLabel )
{
ObjectKind aKind = theLabel.Father().Tag();
+
Handle(HYDROData_Object) aResult;
- switch(aKind) {
+ switch( aKind )
+ {
case KIND_IMAGE:
aResult = new HYDROData_Image();
break;
case KIND_BATHYMETRY:
aResult = new HYDROData_Bathymetry();
break;
+ case KIND_CALCULATION:
+ aResult = new HYDROData_Calculation();
+ break;
}
- if (!aResult.IsNull())
- aResult->SetLabel(theLabel);
+
+ if ( !aResult.IsNull() )
+ aResult->SetLabel( theLabel );
+
return aResult;
}
const ObjectKind KIND_POLYLINE = 2;
const ObjectKind KIND_VISUAL_STATE = 3;
const ObjectKind KIND_BATHYMETRY = 4;
+const ObjectKind KIND_CALCULATION = 5;
DEFINE_STANDARD_HANDLE(HYDROData_Object, MMgt_TShared)
--- /dev/null
+#include <test_HYDROData_Calculation.h>
+
+#include <HYDROData_Calculation.h>
+
--- /dev/null
+
+#include <cppunit/extensions/HelperMacros.h>
+
+class Handle_HYDROData_Calculation;
+class QString;
+
+class HYDROData_Calculation : public CppUnit::TestFixture {
+ CPPUNIT_TEST_SUITE(test_HYDROData_Calculation);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+
+ void setUp() {}
+
+ void tearDown() {}
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(test_HYDROData_Calculation);
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(test_HYDROData_Calculation, "HYDROData_Calculation");