Panda3D
 All Classes Functions Variables Enumerations
qtessInputEntry.h
1 // Filename: qtessInputEntry.h
2 // Created by: drose (13Oct03)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef QTESSINPUTENTRY_H
16 #define QTESSINPUTENTRY_H
17 
18 #include "pandatoolbase.h"
19 #include "globPattern.h"
20 #include "pvector.h"
21 
22 class QtessSurface;
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : QtessInputEntry
26 // Description : Stores one entry in the qtess input file. This
27 // consists of a list of name patterns and a
28 // set of tesselation parameters.
29 ////////////////////////////////////////////////////////////////////
31 public:
32  enum Type {
33  T_undefined, T_omit, T_num_tris, T_uv, T_per_isoparam, T_per_score,
34  T_importance, T_match_uu, T_match_vv, T_match_uv, T_match_vu,
35  T_min_u, T_min_v
36  };
37 
38  QtessInputEntry(const string &name = string());
39  INLINE QtessInputEntry(const QtessInputEntry &copy);
40  void operator = (const QtessInputEntry &copy);
41 
42  INLINE void add_node_name(const string &name);
43  INLINE void set_importance(double i);
44  INLINE void set_match_uu();
45  INLINE void set_match_vv();
46  INLINE void set_match_uv();
47  INLINE void set_match_vu();
48  INLINE void set_min_u(int min_u);
49  INLINE void set_min_v(int min_v);
50  INLINE void set_undefined();
51  INLINE void set_omit();
52  INLINE void set_num_tris(int nt);
53  INLINE void set_uv(int u, int v);
54  void set_uv(int u, int v, const string params[], int num_params);
55  INLINE void set_per_isoparam(double pi);
56  INLINE void set_per_score(double pi);
57  void add_extra_u_isoparam(double u);
58  void add_extra_v_isoparam(double u);
59 
60  Type match(QtessSurface *surface);
61  INLINE int get_num_surfaces() const;
62  int count_tris(double tri_factor = 1.0, int attempts = 0);
63 
64  static void output_extra(ostream &out, const pvector<double> &iso, char axis);
65  void output(ostream &out) const;
66  void write(ostream &out, int indent_level) const;
67 
68  bool _auto_place, _auto_distribute;
69  double _curvature_ratio;
70  double _importance;
71  QtessSurface *_constrain_u, *_constrain_v;
72 
73 private:
75  NodeNames _node_names;
76 
77  int _num_tris;
78  int _num_u, _num_v;
79  double _per_isoparam;
80  pvector<double> _iso_u, _iso_v;
81  Type _type;
82 
84  Surfaces _surfaces;
85 
86  double _num_patches;
87 };
88 
89 INLINE ostream &operator << (ostream &out, const QtessInputEntry &entry);
90 
91 #include "qtessInputEntry.I"
92 
93 #endif
94 
A reference to an EggNurbsSurface in the egg file, and its parameters as set by the user input file a...
Definition: qtessSurface.h:34
int count_tris(double tri_factor=1.0, int attempts=0)
Determines the tesselation u,v amounts of each attached surface, and stores this information in the s...
Stores one entry in the qtess input file.
void add_extra_u_isoparam(double u)
May be called a number of times before set_uv() to add specific additional isoparams to the tesselati...
Type match(QtessSurface *surface)
Tests the surface to see if it matches any of the regular expressions that define this node entry...
static void output_extra(ostream &out, const pvector< double > &iso, char axis)
This function is used to identify the extra isoparams in the list added by user control.
void add_extra_v_isoparam(double u)
May be called a number of times before set_uv() to add specific additional isoparams to the tesselati...