15 #ifndef EGGMESHERSTRIP_H
16 #define EGGMESHERSTRIP_H
18 #include "pandabase.h"
19 #include "eggVertexPool.h"
20 #include "eggPrimitive.h"
21 #include "eggMesherEdge.h"
63 int &num_prims,
int &num_rows,
64 int first_row_id,
int this_row_id,
65 int this_row_distance);
66 void cut_sheet(
int first_row_id,
int do_mate,
75 EggMesherStrip &back, PrimType type);
76 static bool must_invert(
const EggMesherStrip &front,
const EggMesherStrip &back,
77 bool will_reverse_back, PrimType type);
84 INLINE
bool is_coplanar_with(
const EggMesherStrip &other, PN_stdfloat threshold)
const;
85 INLINE PN_stdfloat
coplanarity(
const EggMesherStrip &other)
const;
111 INLINE
bool operator == (
const EggMesherStrip &other)
const;
112 INLINE
bool operator != (
const EggMesherStrip &other)
const;
114 bool pick_mate(
const EggMesherStrip &a_strip,
const EggMesherStrip &b_strip,
119 const EggMesherStrip &b_strip)
const;
121 void output(ostream &out)
const;
140 MesherStatus _status;
144 PN_stdfloat _plane_offset;
145 int _row_id, _row_distance;
146 MesherOrigin _origin;
156 #include "eggMesherStrip.I"
A base class for any of a number of kinds of geometry primitives: polygons, point lights...
bool operator==(const EggMesherStrip &other) const
Defines equality for strips.
int count_neighbors() const
Returns the number of neighbors the strip shares.
void rotate_to_front(const EggMesherEdge *edge)
Rotates a triangle or quad so that the given edge is first in the vertex list.
void rotate_forward()
Rotates a triangle or quad by bringing its first vertex to the back.
static bool mate_strips(EggMesherEdge *common_edge, EggMesherStrip &front, EggMesherStrip &back, PrimType type)
Stitches two strips together, producing in "front" a new strip of the indicated type (quadstrip or tr...
const EggMesherEdge * find_adjacent_edge(const EggMesherEdge *edge) const
Returns the first edge found that shares exactly one vertex with the given edge.
bool mate(const EggVertexPool *vertex_pool)
Finds a neighboring strip and joins up with it to make a larger strip.
void output(ostream &out) const
Formats the vertex for output in some sensible way.
void combine_edges(EggMesherStrip &other, int remove_sides)
Removes the edges from the given strip and appends them to our own.
void rotate_back()
Rotates a triangle or quad by bringing its last vertex to the front.
bool can_invert() const
Returns true if the strip can be inverted (reverse its facing direction).
void measure_sheet(const EggMesherEdge *edge, int new_row, int &num_prims, int &num_rows, int first_row_id, int this_row_id, int this_row_distance)
Determines the extents of the quadsheet that can be derived by starting with this strip...
void convert_to_type(PrimType want_type)
Converts the EggMesherStrip from whatever form it is–triangle, quad, or quadstrip–into a tristrip or ...
void output_neighbors(ostream &out) const
Writes all the neighbor indexes to the ostream.
EggMesherEdge get_tail_edge() const
Returns an EggMesherEdge which represents the trailing edge in the quadstrip or tristrip.
void remove_all_edges()
Removes all active edges from the strip.
static bool convex_quad(EggMesherEdge *common_edge, EggMesherStrip &front, EggMesherStrip &back, const EggVertexPool *vertex_pool)
Returns true if the quad that would be formed by connecting coplanar tris front and back along common...
static bool must_invert(const EggMesherStrip &front, const EggMesherStrip &back, bool will_reverse_back, PrimType type)
Returns false if the strips can be mated as they currently are.
void rotate_to_back(const EggMesherEdge *edge)
Rotates a triangle or quad so that the given edge is last in the vertex list.
Represents one edge of a triangle, as used by the EggMesher to discover connected triangles...
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
int find_uncommon_vertex(const EggMesherEdge *edge) const
Returns the first vertex found that is not shared by the given edge.
bool is_coplanar_with(const EggMesherStrip &other, PN_stdfloat threshold) const
Returns true if the strip and the other strip are coplanar, within the indicated threshold.
bool find_ideal_mate(EggMesherStrip *&mate, EggMesherEdge *&common_edge, const EggVertexPool *vertex_pool)
Searches our neighbors for the most suitable mate.
Represents a triangle strip or quad strip in progress, as assembled by the mesher.
EggMesherEdge get_head_edge() const
Returns an EggMesherEdge which represents the leading edge in the quadstrip or tristrip.
PN_stdfloat coplanarity(const EggMesherStrip &other) const
Returns the degree to which the two strips are coplanar.
int type_category() const
Returns an integer which gives a heuristic about the similarity of different strip types...
static bool mate_pieces(EggMesherEdge *common_edge, EggMesherStrip &front, EggMesherStrip &back, const EggVertexPool *vertex_pool)
Connects two pieces of arbitrary type, if possible.
const EggMesherEdge * find_opposite_edge(int vi) const
Returns the first edge found that does not contain the given vertex.
bool pick_mate(const EggMesherStrip &a_strip, const EggMesherStrip &b_strip, const EggMesherEdge &a_edge, const EggMesherEdge &b_edge, const EggVertexPool *vertex_pool) const
Defines an ordering to select neighbors to mate with.
bool invert()
Reverses the facing of a quadstrip by reversing pairs of vertices.
bool is_odd() const
Returns true if the tristrip or quadstrip contains an odd number of pieces.
A collection of vertices.
bool pick_sheet_mate(const EggMesherStrip &a_strip, const EggMesherStrip &b_strip) const
Defines an ordering to select neighbors to follow when measuring out a quadsheet. ...
bool would_reverse_tail(PrimType want_type) const
Returns true if convert_to_type() would reverse the tail edge of the given strip, false otherwise...