[MOAB-dev] r2140 - MOAB/trunk
tautges at mcs.anl.gov
tautges at mcs.anl.gov
Mon Oct 13 13:09:18 CDT 2008
Author: tautges
Date: 2008-10-13 13:09:18 -0500 (Mon, 13 Oct 2008)
New Revision: 2140
Modified:
MOAB/trunk/ScdElementData.hpp
MOAB/trunk/SequenceManager.cpp
MOAB/trunk/SequenceManager.hpp
Log:
Added function add_vsequence to SequenceManager; a structured element sequence isn't fully formed until it has all the vertex sequences filled out.
Added an assert to connectivity function for structured element sequences to ensure all vertices have been added.
Modified: MOAB/trunk/ScdElementData.hpp
===================================================================
--- MOAB/trunk/ScdElementData.hpp 2008-10-13 14:22:40 UTC (rev 2139)
+++ MOAB/trunk/ScdElementData.hpp 2008-10-13 18:09:18 UTC (rev 2140)
@@ -220,6 +220,7 @@
inline MBEntityHandle ScdElementData::get_vertex(const HomCoord &coords) const
{
+ assert(boundary_complete());
for (std::vector<VertexDataRef>::const_iterator it = vertexSeqRefs.begin();
it != vertexSeqRefs.end(); it++) {
if ((*it).minmax[0] <= coords && (*it).minmax[1] >= coords) {
Modified: MOAB/trunk/SequenceManager.cpp
===================================================================
--- MOAB/trunk/SequenceManager.cpp 2008-10-13 14:22:40 UTC (rev 2139)
+++ MOAB/trunk/SequenceManager.cpp 2008-10-13 18:09:18 UTC (rev 2140)
@@ -684,6 +684,31 @@
type, start_id_hint,
first_handle_out, sequence_out );
}
+
+MBErrorCode
+SequenceManager::add_vsequence(EntitySequence *vert_seq,
+ EntitySequence *elem_seq,
+ const HomCoord &p1, const HomCoord &q1,
+ const HomCoord &p2, const HomCoord &q2,
+ const HomCoord &p3, const HomCoord &q3,
+ bool bb_input,
+ const HomCoord *bb_min,
+ const HomCoord *bb_max)
+{
+ // check first that they're structured vtx/elem sequences
+ ScdVertexData *scd_vd = dynamic_cast<ScdVertexData*>(vert_seq->data());
+ if (!scd_vd) return MB_FAILURE;
+
+ ScdElementData *scd_ed = dynamic_cast<ScdElementData*>(elem_seq->data());
+ if (!scd_ed) return MB_FAILURE;
+
+ if (bb_min && bb_max)
+ return scd_ed->add_vsequence(scd_vd, p1, q1, p2, q2, p3, q3,
+ bb_input, *bb_min, *bb_max);
+ else
+ return scd_ed->add_vsequence(scd_vd, p1, q1, p2, q2, p3, q3,
+ bb_input, HomCoord::unitv[0], HomCoord::unitv[0]);
+}
MBErrorCode
SequenceManager::replace_subsequence( EntitySequence* new_seq, TagServer* ts )
Modified: MOAB/trunk/SequenceManager.hpp
===================================================================
--- MOAB/trunk/SequenceManager.hpp 2008-10-13 14:22:40 UTC (rev 2139)
+++ MOAB/trunk/SequenceManager.hpp 2008-10-13 18:09:18 UTC (rev 2140)
@@ -163,7 +163,18 @@
MBEntityID start_id_hint,
MBEntityHandle& first_handle_out,
EntitySequence*& sequence_out );
-
+
+ /** Add a structured vertex sequence to this structured element sequence;
+ * see comments in ScdElementData */
+ MBErrorCode add_vsequence(EntitySequence *vert_seq,
+ EntitySequence *elem_seq,
+ const HomCoord &p1, const HomCoord &q1,
+ const HomCoord &p2, const HomCoord &q2,
+ const HomCoord &p3, const HomCoord &q3,
+ bool bb_input = false,
+ const HomCoord *bb_min = NULL,
+ const HomCoord *bb_max = NULL);
+
/** Get data for a specific MBEntityType */
TypeSequenceManager& entity_map( MBEntityType type )
{ return typeData[type]; }
More information about the moab-dev
mailing list