SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Traits.h
Go to the documentation of this file.
1 //=========================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //=========================================================================
10 #ifndef smtk_markup_Traits_h
11 #define smtk_markup_Traits_h
12 
14 #include "smtk/markup/Exports.h"
15 
16 #include "smtk/graph/OwnershipSemantics.h"
17 #include "smtk/markup/detail/NodeContainer.h"
18 
20 
21 #include <tuple>
22 
23 namespace smtk
24 {
25 namespace markup
26 {
27 
28 // Forward declare node types
29 class AnalyticShape;
30 class AssignedIds;
31 class Box;
32 class Collection;
33 class Comment;
34 class Component;
35 class CompositeSubset;
36 class Cone;
37 class DiscreteGeometry;
38 class ExplicitSubset;
39 class Feature;
40 class Field;
41 class Frame;
42 class Grid;
43 class Group;
44 class ImageData;
45 class ImplicitShape;
46 class Label;
47 class LabelMap;
48 class Landmark;
49 class NodeSet;
50 class Ontology;
51 class OntologyIdentifier;
52 class Plane;
53 class RangedSubset;
54 class References;
55 class Segmentation;
56 class SideSet;
57 class SpatialData;
58 class Sphere;
59 class Subset;
60 class SurfaceGrid;
61 class URL;
62 class UnstructuredData;
63 class VolumeGrid;
64 
65 namespace arcs
66 {
68 struct SMTKMARKUP_EXPORT GroupsToMembers
69 {
70  using FromType = Group;
71  using ToType = Component;
72  using Directed = std::true_type;
73  static constexpr graph::OwnershipSemantics semantics =
75 };
76 
78 struct SMTKMARKUP_EXPORT LabelsToSubjects
79 {
80  using FromType = Label;
81  using ToType = Component;
82  using Directed = std::true_type;
83 };
84 
86 struct SMTKMARKUP_EXPORT URLsToData
87 {
88  using FromType = URL;
89  using ToType = Component;
90  using Directed = std::true_type;
91  static constexpr std::size_t maxInDegree = 1; // Data has a single source.
92 };
93 
94 struct SMTKMARKUP_EXPORT URLsToImportedData
95 {
96  using FromType = URL;
97  using ToType = Component;
98  using Directed = std::true_type;
99 };
100 
102 struct SMTKMARKUP_EXPORT OntologyIdentifiersToIndividuals
103 {
105  using ToType = Component;
106  using Directed = std::true_type;
108  static constexpr graph::OwnershipSemantics semantics =
110 };
111 
113 struct SMTKMARKUP_EXPORT OntologyIdentifiersToSubtypes
114 {
116  using ToType = OntologyIdentifier;
117  using Directed = std::true_type;
118 };
119 
121 struct SMTKMARKUP_EXPORT OntologyToIdentifiers
122 {
123  using FromType = Ontology;
124  using ToType = OntologyIdentifier;
125  using Directed = std::true_type;
126  static constexpr std::size_t maxInDegree = 1; // Identifiers have a single parent ontology.
127 };
128 
130 struct SMTKMARKUP_EXPORT FieldsToShapes
131 {
132  using FromType = Field;
133  using ToType = SpatialData;
134  using Directed = std::true_type;
135  static constexpr std::size_t minInDegree = 1; // Fields must have a domain.
136  static constexpr std::size_t maxInDegree = 1; // Fields have a single domain (for now).
137 };
138 
141 struct SMTKMARKUP_EXPORT BoundariesToShapes
142 {
143  using FromType = SpatialData;
144  using ToType = SpatialData;
145  using Directed = std::true_type;
146  // You cannot delete a boundary without also deleting the things it bounds:
147  static constexpr graph::OwnershipSemantics semantics =
149 };
150 } // namespace arcs
151 
152 // Forward-declare domain types
153 class BoundaryOperator;
154 class IdSpace;
155 class Index;
156 class ParameterSpace;
157 
161 struct SMTKMARKUP_EXPORT Traits
162 {
163  using NodeTypes = std::tuple<
165  // AssignedIds,
166  Box,
167  // Collection,
168  Comment,
169  Component,
170  // CompositeSubset,
171  Cone,
173  // ExplicitSubset,
174  Feature,
175  Field,
176  // Frame,
177  // Grid,
178  Group,
179  ImageData,
180  // ImplicitShape,
181  Label,
182  // LabelMap,
183  Landmark,
184  NodeSet,
185  Ontology,
187  Plane,
188  // RangedSubset,
189  // References,
190  // Segmentation,
191  SideSet,
192  SpatialData,
193  Sphere,
194  Subset,
195  // SurfaceGrid,
196  URL,
198  // VolumeGrid
199  >;
200  using ArcTypes = std::tuple<
211  using NodeContainer = detail::NodeContainer;
212  using DomainTypes = std::tuple<BoundaryOperator, IdSpace, Index, ParameterSpace>;
213 };
214 } // namespace markup
215 } // namespace smtk
216 
217 // Include node types
218 
219 #include "smtk/markup/AnalyticShape.h"
220 #include "smtk/markup/AssignedIds.h"
221 #include "smtk/markup/Box.h"
222 // #include "smtk/markup/Collection.h"
223 #include "smtk/markup/Comment.h"
224 // #include "smtk/markup/Component.h"
225 // #include "smtk/markup/CompositeSubset.h"
226 #include "smtk/markup/Cone.h"
227 #include "smtk/markup/DiscreteGeometry.h"
228 // #include "smtk/markup/ExplicitSubset.h"
229 #include "smtk/markup/Feature.h"
230 #include "smtk/markup/Field.h"
231 // #include "smtk/markup/Frame.h"
232 // #include "smtk/markup/Grid.h"
233 #include "smtk/markup/Group.h"
234 #include "smtk/markup/ImageData.h"
235 // #include "smtk/markup/ImplicitShape.h"
236 #include "smtk/markup/Label.h"
237 // #include "smtk/markup/LabelMap.h"
238 #include "smtk/markup/Landmark.h"
239 #include "smtk/markup/NodeSet.h"
240 #include "smtk/markup/Ontology.h"
241 #include "smtk/markup/OntologyIdentifier.h"
242 #include "smtk/markup/Plane.h"
243 // #include "smtk/markup/RangedSubset.h"
244 // #include "smtk/markup/References.h"
245 // #include "smtk/markup/Segmentation.h"
246 #include "smtk/markup/SideSet.h"
247 #include "smtk/markup/SpatialData.h"
248 #include "smtk/markup/Sphere.h"
249 #include "smtk/markup/Subset.h"
250 // #include "smtk/markup/SurfaceGrid.h"
251 #include "smtk/markup/URL.h"
252 #include "smtk/markup/UnstructuredData.h"
253 // #include "smtk/markup/VolumeGrid.h"
254 
255 // Include domain types
256 #include "smtk/markup/BoundaryOperator.h"
257 #include "smtk/markup/Domain.h"
258 #include "smtk/markup/IdSpace.h"
259 #include "smtk/markup/Index.h"
260 #include "smtk/markup/ParameterSpace.h"
261 
262 #endif
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
smtk::markup::OntologyIdentifier
An entry in an ontology used to label components.
Definition: OntologyIdentifier.h:45
smtk::graph::OwnershipSemantics
OwnershipSemantics
Indicate whether one arc endpoint "owns" the other.
Definition: OwnershipSemantics.h:19
smtk::markup::AnalyticShape
Simple shapes that have analytic representations, generally as implicit, trivariate functions whose z...
Definition: AnalyticShape.h:23
smtk::markup::arcs::OntologyToIdentifiers
Arcs connecting an ontology to all of its identifiers.
Definition: Traits.h:121
smtk::markup::ImageData
Definition: ImageData.h:24
smtk::markup::arcs::URLsToData
Arcs connecting URLs to data held at its location.
Definition: Traits.h:86
smtk::markup::arcs::GroupsToMembers
Arcs connecting groups to their members and vice-versa.
Definition: Traits.h:68
smtk::markup::Comment
Definition: Comment.h:22
smtk::markup::DiscreteGeometry
Represent a discrete geometric shape as a modeling entity.
Definition: DiscreteGeometry.h:33
smtk::markup::Component
Definition: Component.h:56
smtk::markup::Cone
A ruled 3-dimensional surface identified by 2 points and 2 radii.
Definition: Cone.h:21
smtk::markup::Field
A function defined over some shape's space.
Definition: Field.h:35
smtk::markup::arcs::OntologyIdentifiersToIndividuals
Arcs connecting ontology identifiers to their subjects.
Definition: Traits.h:102
smtk::markup::Group
A set of components owned by this component.
Definition: Group.h:28
ReferencesToPrimaries.h
smtk::markup::SpatialData
Markup nodes that have spatial extents.
Definition: SpatialData.h:36
smtk::markup::arcs::OntologyIdentifiersToSubtypes
Arcs connecting an ontology identifier to other identifiers derivde from it.
Definition: Traits.h:113
smtk::markup::Landmark
A spatial landmark.
Definition: Landmark.h:31
smtk::markup::arcs::ReferencesToPrimaries
Arcs connecting spatial data to the domains over which they are defined.
Definition: ReferencesToPrimaries.h:39
smtk::markup::ParameterSpace
A dataset whose spatial extents serve as the domain of a map into a different coordinate system.
Definition: ParameterSpace.h:29
smtk::markup::NodeSet
An adaptation of subsets for representing subsets of points.
Definition: NodeSet.h:28
smtk::markup::Label
Definition: Label.h:20
smtk::markup::arcs::URLsToImportedData
Definition: Traits.h:94
smtk::markup::IdSpace
A numbering used in a context.
Definition: IdSpace.h:36
smtk::markup::BoundaryOperator
A discrete mapping from one IdSpace into another that enumerates boundaries of the domain.
Definition: BoundaryOperator.h:27
smtk::io::mesh::Subset
Subset
Mesh subset types.
Definition: MeshIO.h:30
smtk::markup::Subset
Definition: Subset.h:27
smtk::markup::SideSet
An adaptation of subsets for representing subsets of boundaries of spatial data.
Definition: SideSet.h:26
smtk::markup::UnstructuredData
Definition: UnstructuredData.h:26
smtk::markup::URL
Definition: URL.h:27
smtk::markup::Box
A 3-dimensional, 6-sided shape with axis-aligned planar surfaces.
Definition: Box.h:21
smtk::markup::Feature
Definition: Feature.h:20
smtk::markup::arcs::LabelsToSubjects
Arcs connecting labels to their subjects and vice-versa.
Definition: Traits.h:78
smtk::markup::Sphere
A 3-dimensional surface of constant non-zero curvature identified by a point and radius.
Definition: Sphere.h:21
smtk::markup::Traits
Traits that describe markup node and arc types.
Definition: Traits.h:161
smtk::markup::Plane
A flat 3-dimensional surface identified by a point and normal.
Definition: Plane.h:21
smtk::markup::Index
A catalog that orders numbers in an IdSpace according to some field.
Definition: Index.h:27
smtk::markup::arcs::FieldsToShapes
Arcs connecting spatial data (defining a shape) to functions defined over those spaces.
Definition: Traits.h:130
smtk::graph::OwnershipSemantics::ToNodeOwnsFromNode
@ ToNodeOwnsFromNode
The "to" node owns the "from" node.
smtk::markup::Ontology
A collection of labels related to one another by relationships, typically imported from an OWL.
Definition: Ontology.h:23
smtk::markup::arcs::BoundariesToShapes
Arcs connecting boundary shapes to the higher-dimensional shapes they bound.
Definition: Traits.h:141