Browse Source

New DEM project

master
Trevor Irons 6 years ago
commit
53a3218338

+ 17
- 0
CMakeLists.txt View File

@@ -0,0 +1,17 @@
1
+if (LEMMA_VTK6_SUPPORT OR LEMMA_VTK7_SUPPORT)
2
+	include_directories(${CMAKE_INSTALL_PREFIX}/include)
3
+
4
+	include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/include" )
5
+	add_subdirectory("src")
6
+
7
+	add_library( dem4core ${DEMSOURCE} )  
8
+	target_link_libraries(dem4core "lemmacore")
9
+
10
+	install ( TARGETS dem4core DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
11
+
12
+	if (LEMMA_BUILD_EXAMPLES)
13
+		add_subdirectory(examples)
14
+	endif()
15
+else()
16
+	message( STATUS "DEM requires Lemma to be build with VTK" )
17
+endif()

+ 0
- 0
dox/README.txt View File


+ 6
- 0
examples/CMakeLists.txt View File

@@ -0,0 +1,6 @@
1
+add_executable( DEMGrain DEMGrain.cpp  )
2
+target_link_libraries(  DEMGrain  "lemmacore" "dem4core")
3
+
4
+INSTALL_TARGETS( "/share/DEM/"
5
+	DEMGrain 
6
+)

+ 30
- 0
examples/DEMGrain.cpp View File

@@ -0,0 +1,30 @@
1
+/* This file is part of Lemma, a geophysical modelling and inversion API.
2
+ * More information is available at http://lemmasoftware.org
3
+ */
4
+
5
+/* This Source Code Form is subject to the terms of the Mozilla Public
6
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
7
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
+ */
9
+
10
+/**
11
+ * @file
12
+ * @date      05/31/2016 12:27:49 PM
13
+ * @version   $Id$
14
+ * @author    Trevor Irons (ti)
15
+ * @email     tirons@egi.utah.edu
16
+ * @copyright Copyright (c) 2016, University of Utah
17
+ * @copyright Copyright (c) 2016, Lemma Software, LLC
18
+ */
19
+
20
+
21
+#include "Lemma"
22
+#include "DEM4Core"
23
+using namespace Lemma;
24
+
25
+
26
+int main()
27
+{
28
+    std::cout << "Hello DEM" << std::endl;
29
+}
30
+

BIN
include/.DEMParticle.h.swp View File


+ 1
- 0
include/DEM4Core View File

@@ -0,0 +1 @@
1
+

+ 103
- 0
include/DEMParticle.h View File

@@ -0,0 +1,103 @@
1
+/* This file is part of Lemma, a geophysical modelling and inversion API.
2
+ * More information is available at http://lemmasoftware.org
3
+ */
4
+
5
+/* This Source Code Form is subject to the terms of the Mozilla Public
6
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
7
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
+ */
9
+
10
+/**
11
+ * @file
12
+ * @date      05/31/2016 01:31:28 PM
13
+ * @version   $Id$
14
+ * @author    Trevor Irons (ti)
15
+ * @email     tirons@egi.utah.edu
16
+ * @copyright Copyright (c) 2016, University of Utah
17
+ * @copyright Copyright (c) 2016, Lemma Software, LLC
18
+ */
19
+
20
+#ifndef  DEMPARTICLE_INC
21
+#define  DEMPARTICLE_INC
22
+
23
+#include "LemmaObject.h"
24
+
25
+namespace Lemma {
26
+
27
+    /**
28
+      \brief
29
+      \details
30
+     */
31
+    class DEMParticle : public LemmaObject {
32
+
33
+        friend std::ostream &operator<<(std::ostream &stream,
34
+                const DEMParticle &ob);
35
+
36
+        public:
37
+
38
+        // ====================  LIFECYCLE     =======================
39
+
40
+        /**
41
+         * @copybrief LemmaObject::New()
42
+         * @copydetails LemmaObject::New()
43
+         */
44
+        static DEMParticle* New();
45
+
46
+        /**
47
+         *  @copybrief   LemmaObject::Delete()
48
+         *  @copydetails LemmaObject::Delete()
49
+         */
50
+        void Delete();
51
+
52
+        // ====================  OPERATORS     =======================
53
+
54
+        // ====================  OPERATIONS    =======================
55
+
56
+        // ====================  ACCESS        =======================
57
+
58
+        // ====================  INQUIRY       =======================
59
+
60
+#ifdef HAVE_YAMLCPP
61
+        /**
62
+         *  Uses YAML to serialize this object.
63
+         *  @return a YAML::Node
64
+         */
65
+        YAML::Node Serialize() const;
66
+
67
+        /**
68
+         *   Constructs an object from a YAML::Node.
69
+         */
70
+        static DEMParticle* DeSerialize(const YAML::Node& node);
71
+#endif
72
+
73
+        protected:
74
+
75
+        // ====================  LIFECYCLE     =======================
76
+
77
+        /** Default protected constructor, use New */
78
+        DEMParticle (const std::string& name);
79
+
80
+#ifdef HAVE_YAMLCPP
81
+        /** Protected DeDerializing constructor, use factory DeSerialize  method*/
82
+        DEMParticle (const YAML::Node& node);
83
+#endif
84
+
85
+        /** Default protected destructor, use Delete */
86
+        ~DEMParticle ();
87
+
88
+        /**
89
+         *  @copybrief   LemmaObject::Release()
90
+         *  @copydetails LemmaObject::Release()
91
+         */
92
+        void Release();
93
+
94
+        private:
95
+
96
+        // ====================  DATA MEMBERS  =========================
97
+
98
+    }; // -----  end of class  DEMParticle  -----
99
+
100
+}		// -----  end of Lemma  name  -----
101
+
102
+#endif   // ----- #ifndef DEMPARTICLE_INC  -----
103
+

BIN
src/.DEMObject.cpp.swp View File


+ 5
- 0
src/CMakeLists.txt View File

@@ -0,0 +1,5 @@
1
+set (DEMSOURCE
2
+	${DEMSOURCE}
3
+	${CMAKE_CURRENT_SOURCE_DIR}/DEMParticle.cpp
4
+	PARENT_SCOPE
5
+)

+ 124
- 0
src/DEMParticle.cpp View File

@@ -0,0 +1,124 @@
1
+/* This file is part of Lemma, a geophysical modelling and inversion API.
2
+ * More information is available at http://lemmasoftware.org
3
+ */
4
+
5
+/* This Source Code Form is subject to the terms of the Mozilla Public
6
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
7
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
+ */
9
+
10
+/**
11
+ * @file
12
+ * @date      05/31/2016 12:27:31 PM
13
+ * @version   $Id$
14
+ * @author    Trevor Irons (ti)
15
+ * @email     tirons@egi.utah.edu
16
+ * @copyright Copyright (c) 2016, University of Utah
17
+ * @copyright Copyright (c) 2016, Lemma Software, LLC
18
+ */
19
+
20
+#include "DEMParticle.h"
21
+
22
+namespace Lemma {
23
+
24
+// ====================  FRIEND METHODS  =====================
25
+#ifdef HAVE_YAMLCPP
26
+std::ostream &operator << (std::ostream &stream, const DEMParticle &ob) {
27
+    stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
28
+    return stream;
29
+}
30
+#else
31
+std::ostream &operator<<(std::ostream &stream, const DEMParticle& ob) {
32
+    stream << *(LemmaObject*)(&ob);
33
+    return stream;
34
+}
35
+#endif
36
+
37
+// ====================  LIFECYCLE     =======================
38
+
39
+//--------------------------------------------------------------------------------------
40
+//       Class:  DEMParticle
41
+//      Method:  DEMParticle
42
+// Description:  constructor (protected)
43
+//--------------------------------------------------------------------------------------
44
+DEMParticle::DEMParticle (const std::string& name) : LemmaObject(name) {
45
+
46
+}  // -----  end of method DEMParticle::DEMParticle  (constructor)  -----
47
+
48
+#ifdef HAVE_YAMLCPP
49
+//--------------------------------------------------------------------------------------
50
+//       Class:  DEMParticle
51
+//      Method:  DEMParticle
52
+// Description:  DeSerializing constructor (protected)
53
+//--------------------------------------------------------------------------------------
54
+DEMParticle::DEMParticle (const YAML::Node& node) : LemmaObject(node) {
55
+
56
+}  // -----  end of method DEMParticle::DEMParticle  (constructor)  -----
57
+#endif
58
+
59
+//--------------------------------------------------------------------------------------
60
+//       Class:  DEMParticle
61
+//      Method:  New()
62
+// Description:  public constructor
63
+//--------------------------------------------------------------------------------------
64
+DEMParticle* DEMParticle::New() {
65
+    DEMParticle*  Obj = new DEMParticle("DEMParticle");
66
+    Obj->AttachTo(Obj);
67
+    return Obj;
68
+}
69
+
70
+//--------------------------------------------------------------------------------------
71
+//       Class:  DEMParticle
72
+//      Method:  ~DEMParticle
73
+// Description:  destructor (protected)
74
+//--------------------------------------------------------------------------------------
75
+DEMParticle::~DEMParticle () {
76
+
77
+}  // -----  end of method DEMParticle::~DEMParticle  (destructor)  -----
78
+
79
+//--------------------------------------------------------------------------------------
80
+//       Class:  DEMParticle
81
+//      Method:  Delete
82
+// Description:  public destructor
83
+//--------------------------------------------------------------------------------------
84
+void DEMParticle::Delete() {
85
+    this->DetachFrom(this);
86
+}
87
+
88
+//--------------------------------------------------------------------------------------
89
+//       Class:  DEMParticle
90
+//      Method:  Release
91
+// Description:  destructor (protected)
92
+//--------------------------------------------------------------------------------------
93
+void DEMParticle::Release() {
94
+    delete this;
95
+}
96
+
97
+
98
+#ifdef HAVE_YAMLCPP
99
+//--------------------------------------------------------------------------------------
100
+//       Class:  DEMParticle
101
+//      Method:  Serialize
102
+//--------------------------------------------------------------------------------------
103
+YAML::Node  DEMParticle::Serialize (  ) const {
104
+    YAML::Node node = LemmaObject::Serialize();;
105
+    node.SetTag( this->Name );
106
+    // FILL IN CLASS SPECIFICS HERE
107
+    return node;
108
+}		// -----  end of method DEMParticle::Serialize  -----
109
+
110
+
111
+//--------------------------------------------------------------------------------------
112
+//       Class:  DEMParticle
113
+//      Method:  DeSerialize
114
+//--------------------------------------------------------------------------------------
115
+DEMParticle* DEMParticle::DeSerialize ( const YAML::Node& node  ) {
116
+    DEMParticle* Object = new DEMParticle(node);
117
+    Object->AttachTo(Object);
118
+    DESERIALIZECHECK( node, Object )
119
+        return Object ;
120
+}		// -----  end of method DEMParticle::DeSerialize  -----
121
+#endif
122
+
123
+}		// -----  end of Lemma  name  -----
124
+

Loading…
Cancel
Save