SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
10 #ifndef smtk_session_polygon_Fragment_h
11 #define smtk_session_polygon_Fragment_h
13 #include "smtk/session/polygon/internal/Config.h"
15 #include "smtk/model/Edge.h"
17 #include "smtk/common/UnionFind.h"
27 struct EdgeFragmentComparator;
31 struct SweeplinePosition;
33 typedef size_t FragmentId;
35 typedef std::vector<SweepEvent> SweepEventArray;
36 typedef std::vector<EdgeFragment> FragmentArray;
47 internal::EdgePtr m_edgeData;
62 bool orientation()
const {
return m_sense; }
64 internal::Point& lo() {
return m_lo; }
65 const internal::Point& lo()
const {
return m_lo; }
67 internal::Point& hi() {
return m_hi; }
68 const internal::Point& hi()
const {
return m_hi; }
92 return m_regionId[fromLowerEnd ? 1 : 0];
102 return m_regionId[fromLowerEnd ? 0 : 1];
108 FragmentId&
nextFragment(
bool forwardDir) {
return m_next[forwardDir ? 1 : 0]; }
109 bool& nextFragmentSense(
bool forwardDir) {
return m_nsns[forwardDir ? 1 : 0]; }
112 void mark(
bool orientation,
int markVal) { m_marked[orientation ? 1 : 0] = markVal; }
115 int marked(
bool orientation)
const {
return m_marked[orientation ? 1 : 0]; }
124 FragmentArray* m_sweptFragments;
131 FragmentArray*
fragments()
const {
return m_sweptFragments; }
133 bool operator()(FragmentId a, FragmentId b)
const;
138 internal::Point m_position;
146 const internal::Point&
position()
const {
return m_position; }
149 void advance(
const internal::Point& pt);
151 bool operator<(
const internal::Point& other) {
return m_position < other; }
152 bool operator>(
const internal::Point& other) {
return m_position > other; }
153 bool operator==(
const internal::Point& other) {
return m_position == other; }
154 bool operator!=(
const internal::Point& other) {
return m_position != other; }
161 #endif // smtk_session_polygon_Fragment_h
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
RegionId value_type
Each value used to identify a set is of this type.
Definition: UnionFind.h:57
bool operator()(FragmentId a, FragmentId b) const
Return true when line a lies to the left of and/or below line b for the current sweepLocation.
Definition: Fragment.cxx:60
void dump(RegionIdSet &ufind) const
Debug dump of fragment.
Definition: Fragment.cxx:32
RegionIdSet::value_type & ccwRegion(bool fromLowerEnd)
Return the ID of the region just counter-clockwise (CCW) of the fragment...
Definition: Fragment.h:89
std::set< SweepEvent > SweepEventSet
Sweep events ordered by their left-, lower-most point coordinates.
Definition: Fragment.h:34
void mark(bool orientation, int markVal)
Mark a co-fragment as visited (or not).
Definition: Fragment.h:112
Functor to compare indices into a vector of EdgeFragments based on which fragment is above the other.
Definition: Fragment.h:122
A entityref subclass that provides methods specific to 1-d edge cells.
Definition: Edge.h:32
internal::Point & position()
Return the current sweepline position.
Definition: Fragment.h:143
std::map< RegionId, smtk::shared_ptr< Region > > RegionDefinitions
A map to hold each region's definition indexed by its UF region ID.
Definition: Fragment.h:39
FragmentArray * fragments() const
Return the array of fragments the comparator indexes into.
Definition: Fragment.h:131
smtk::common::UnionFind< RegionId > RegionIdSet
The set of all regions is a UnionFind (UF) data structure.
Definition: Fragment.h:38
RegionIdSet::value_type & cwRegion(bool fromLowerEnd)
Return the ID of the region just clockwise (CW) of the fragment...
Definition: Fragment.h:99
void advance(const internal::Point &pt)
Advance the sweepline to another position, ignoring invalid points to the left of the current positio...
Definition: Fragment.cxx:185
const internal::Point & position() const
Return the current sweepline position.
Definition: Fragment.h:146
RegionIdSet::value_type & lowerRegion()
Return the ID of the region below the fragment.
Definition: Fragment.h:74
Structure to hold information about a portion of an edge-segment forming part of an output loop.
Definition: Fragment.h:42
FragmentId & nextFragment(bool forwardDir)
Return the next fragment bounding the region to the left of the fragment.
Definition: Fragment.h:108
int marked(bool orientation) const
Return the markings on the forward (orientation true) or backward (false) co-fragment.
Definition: Fragment.h:115
Definition: Fragment.h:136
RegionIdSet::value_type & upperRegion()
Return the ID of the region above the fragment.
Definition: Fragment.h:71