00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __GR_Detail_h__
00021 #define __GR_Detail_h__
00022
00023 #include "GR_API.h"
00024 #include <UT/UT_Defines.h>
00025 #include <UT/UT_PtrArray.h>
00026 #include <UT/UT_ErrorManager.h>
00027 #include "GR_AttribOffset.h"
00028
00029
00030 #define GR_LOD_LOW 0.5f
00031 #define GR_LOD_HIGH 3.0f
00032
00033 #define GR_SYMBOL_SELCV 10
00034
00035 class UT_Color;
00036 class UT_Vector3;
00037 class UT_Vector4;
00038 class UT_Matrix3;
00039 class UT_Matrix4;
00040 class UT_BoundingBox;
00041 class UT_IntArray;
00042 class RE_Render;
00043 class RE_Material;
00044 class RE_Displace;
00045 class GB_Primitive;
00046 class GB_PrimitiveGroup;
00047 class GB_PointGroup;
00048 class GEO_Primitive;
00049 class GEO_Vertex;
00050 class GEO_Point;
00051 class GEO_Quadric;
00052 class GU_Curve;
00053 class GU_Detail;
00054 class GU_BreakpointSelection;
00055 class GU_EdgeSelection;
00056 class GU_VertexSelection;
00057 class GU_Primitive;
00058 class GU_PrimMesh;
00059 class GU_PrimPoly;
00060 class GU_PrimCircle;
00061 class GU_PrimSphere;
00062 class GU_PrimMetaBall;
00063 class GU_PrimMetaSQuad;
00064 class GU_PrimTriBezier;
00065 class GU_PrimTriFan;
00066 class GU_PrimTriStrip;
00067 class GU_PrimTube;
00068 class GU_PrimParticle;
00069 class GU_PrimVolume;
00070 class GU_Selection;
00071 class GU_SelectionList;
00072 class GU_TPSurf;
00073 class GU_PrimGroupClosure;
00074 class GEO_Face;
00075 class GEO_Hull;
00076 class GVEX_MeshShader;
00077 class RE_Light;
00078 class OP_Node;
00079
00080 class GR_DisplayOption;
00081 class GR_RenderTable;
00082 class GR_UserDecoration;
00083
00084 class gr_PrimMaterial;
00085
00086 typedef UT_PtrArray<GR_UserDecoration *> GR_DecorationList;
00087
00088 typedef void (*GR_WRITE_VERTEX)(RE_Render &, const GEO_Vertex &,
00089 const GR_AttribOffset &);
00090
00091 extern "C" {
00092 DLLEXPORT extern void newRenderHook(GR_RenderTable *table);
00093 };
00094
00095 class GR_API GR_Detail
00096 {
00097 public:
00098 GR_Detail() {}
00099 ~GR_Detail() {}
00100
00101
00102
00103
00104
00105
00106
00107 static void bootstrapInternalCaches(RE_Render &ren);
00108
00109
00110 static int queryNewLOD(const GU_Detail *gdp,
00111 RE_Render &ren, float lod,
00112 float &newlod);
00113
00114 static void computeViewDirection(RE_Render &ren);
00115 static const UT_Vector3 &getViewDirection();
00116 static const UT_Vector3 &getViewOrigin();
00117
00118 static void toggleLightShading(RE_Render &ren, int onoff);
00119
00120 static bool usingVertexDiffuseMaterial()
00121 { return theVertexDiffuseMaterialFlag; }
00122
00123
00124
00125
00126 static bool delayUnlitPrimitive(GEO_Primitive *prim);
00127
00128
00129
00130
00131
00132
00133 static bool enableDelayOfUnlitPrimitives(bool enable);
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145 void boundBoxDraw(GU_Detail *gdp, RE_Render &ren,
00146 int drawselect,
00147 const GU_PrimGroupClosure *hidden_geometry,
00148 const GR_DisplayOption *drawOpt) const;
00149 void wireDraw(GU_Detail *gdp, RE_Render &ren, float lod,
00150 int drawselect,
00151 const GU_PrimGroupClosure *hidden_geometry = 0,
00152 const GR_DisplayOption *dopt = 0,
00153 UT_Bool attribs = UT_TRUE,
00154 OP_Node *shopsRelativeTo = 0) const;
00155 void wireDrawProfiles(GU_Detail &gdp, GEO_Primitive *prim,
00156 RE_Render &ren, GR_DisplayOption *dopt,
00157 int drawselect,
00158 const GR_AttribOffset &ptinfo, float lod,
00159 const GU_PrimGroupClosure *hidden_geometry,
00160 int &cullCount) const;
00161
00162 int shadedSimpleDraw(GU_Detail *gdp, RE_Render &ren, float lod,
00163 RE_Material *remat = NULL,
00164 const GR_DisplayOption *dopt=0,
00165 const GU_PrimGroupClosure *hidden_geometry = 0)
00166 const;
00167
00168
00169
00170
00171 void wireDumbDraw(GU_Detail *gdp, RE_Render &ren) const;
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183 int shadedDraw( GU_Detail *gdp, RE_Render &ren, float lod,
00184 RE_Material *rem,
00185 int drawselect,
00186 const GU_PrimGroupClosure *hidden_geometry=0,
00187 const GR_DisplayOption *dopt=0,
00188 float time=0,
00189 UT_Matrix4 *shadexform = 0,
00190 UT_Matrix4 *worldxform = 0,
00191 int drawLit=1,
00192 UT_Bool attribs = UT_TRUE,
00193 OP_Node *shopsRelativeTo = 0) const;
00194
00195 int vexShadedDraw(GU_Detail *gdp, RE_Render &ren, float lod,
00196 RE_Material *rem, RE_Displace *redisp,
00197 RE_Light *lights[], int light_count,
00198 int drawselect,
00199 const UT_Matrix4 &shadexform,
00200 const UT_Matrix4 &worldxform,
00201 const GU_PrimGroupClosure *hidden_geometry=0,
00202 const GR_DisplayOption *dopt=0,
00203 float time=0,
00204 GVEX_MeshShader *mshader=0,
00205 UT_Bool attribs = UT_TRUE,
00206 OP_Node *shopsRelativeTo = 0) const;
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239 void wirePick(GU_Detail *gdp, RE_Render &ren, float lod,
00240 int drawselect,
00241 const GU_PrimGroupClosure *hidden_geometry,
00242 const GR_DisplayOption *dopt = 0) const;
00243 void wirePickProfiles(GU_Detail *gdp, GEO_Primitive *prim,
00244 RE_Render &ren, GR_DisplayOption *dopt,
00245 int drawselect,
00246 const GR_AttribOffset &ptinfo,
00247 float lod, int &cullCount) const;
00248 void wirePickPrimitive(GEO_Primitive *prim, RE_Render &ren,
00249 const GR_AttribOffset &ptinfo,
00250 const GR_DisplayOption &drawOpt,
00251 float lod, int &cullCount) const;
00252 void wirePickPrimitive(GEO_Primitive *prim, GB_Primitive *,
00253 RE_Render &ren,
00254 const GR_AttribOffset &ptinfo,
00255 const GR_DisplayOption &drawOpt,
00256 float lod, int &cullCount) const;
00257
00258 void shadedPick(GU_Detail *gdp, RE_Render &ren, float lod,
00259 int drawselect,
00260 const GU_PrimGroupClosure *hidden_geometry,
00261 const GR_DisplayOption *dopt=0) const;
00262 void shadedPickPrimitive(GEO_Primitive *prim, RE_Render &ren,
00263 const GR_AttribOffset &ptinfo,
00264 const GR_DisplayOption &drawOpt,
00265 float lod, int &cullCount) const;
00266
00267
00268 void addError(UT_Error *error) const
00269 { UTaddError(error); }
00270 void addError(int code, const char *msg = 0) const
00271 { UTaddError("GR", code, msg); }
00272 void addWarning(int code, const char *msg = 0) const
00273 { UTaddWarning("GR", code, msg); }
00274
00275 private:
00276
00277
00278
00279 void drawBoundingBox(UT_BoundingBox bbox, RE_Render &ren,
00280 const GR_DisplayOption *drawOpt,
00281 UT_Color *color) const;
00282
00283 void drawZArrow(UT_BoundingBox bbox, RE_Render &ren,
00284 const GR_DisplayOption *drawOpt,
00285 UT_Color *color) const;
00286
00287 void boundBoxSelectDraw(GU_Detail *gdp, GU_Selection *selection,
00288 RE_Render &ren,
00289 const GR_DisplayOption *drawOpt,
00290 const UT_Color &selcolor) const;
00291
00292 int vexDrawPrimitive(GEO_Primitive *prim, RE_Render &ren,
00293 const UT_Matrix4 &camxform,
00294 const UT_Matrix4 &icamxform,
00295 const GR_DisplayOption &drawOpt,
00296 GVEX_MeshShader &shader, int &nmloff,
00297 int &cullCount, float lod,
00298 const GR_AttribOffset &ptinfo) const;
00299
00300 void shadedDrawPrimitive(GEO_Primitive *prim, RE_Render &ren,
00301 const GR_AttribOffset &ptinfo,
00302 const GR_DisplayOption &drawOpt,
00303 float lod, int &cullCount,
00304 float t = 0) const;
00305
00306 void shadedDrawUnlitPrimitives(GU_Detail *gdp, RE_Render &ren,
00307 const GR_DisplayOption &drawOpt,
00308 const GR_AttribOffset &ptinfo, float lod,
00309 const UT_IntArray &prim_list,
00310 bool use_prim_clr) const;
00311
00312 void shadedDrawUnlitPrimitive(GEO_Primitive *prim, RE_Render &ren,
00313 const GR_AttribOffset &ptinfo,
00314 const GR_DisplayOption &drawOpt,
00315 float lod) const;
00316
00317 void depthDrawPrimitives(GU_Detail *gdp, RE_Render &ren,
00318 const GR_DisplayOption &drawOpt,
00319 int drawselect,
00320 const GR_AttribOffset &ptinfoIn,
00321 float lod,
00322 const GU_PrimGroupClosure *hidden_geometry,
00323 UT_Bool allattribs) const;
00324
00325 void metaWireDraw(GU_Detail *gdp, RE_Render &ren,
00326 const GR_DisplayOption &drawopt,
00327 const GR_AttribOffset &ptInfo,
00328 float lod,
00329 const GU_PrimGroupClosure *hidden_geometry)
00330 const;
00331 void metaWirePolyDraw(GU_Detail *srcgdp, RE_Render &ren,
00332 const GR_DisplayOption &drawopt,
00333 const GR_AttribOffset &ptinfo,
00334 float lod,
00335 const GU_PrimGroupClosure *hidden_geometry)
00336 const;
00337 void trimeshWireDraw(GU_Detail *gdp, RE_Render &ren,
00338 float lod,
00339 const GR_AttribOffset &ptInfo,
00340 const GU_PrimGroupClosure *hidden_geometry)
00341 const;
00342 void trimeshShadedDraw(GU_Detail *gdp, RE_Render &ren,
00343 const GR_DisplayOption &drawOpt,
00344 float lod,
00345 const GR_AttribOffset &ptInfo,
00346 float t) const;
00347 void metaShadedDraw(GU_Detail *gdp, RE_Render &ren,
00348 const GR_DisplayOption &drawopt,
00349 const GR_AttribOffset &ptInfo,
00350 const GU_PrimGroupClosure *hidden_geometry,
00351 float lod = 1) const;
00352
00353
00354
00355
00356
00357
00358 void wireDrawPrimitives(GU_Detail *gdp, RE_Render &ren,
00359 const GR_DisplayOption &drawopt,
00360 int drawselect,
00361 GR_AttribOffset &ptInfo,
00362 float lod = 1,
00363 const GU_PrimGroupClosure *hidden_geometry=0)
00364 const;
00365 void wireDrawPrimitive(GEO_Primitive *prim, RE_Render &ren,
00366 const GR_AttribOffset &ptinfo,
00367 const GR_DisplayOption &drawOpt,
00368 float lod, int &cullCount) const;
00369 void wireDrawPrimitive(GEO_Primitive *prim, GB_Primitive *sec,
00370 RE_Render &ren,
00371 const GR_AttribOffset &ptinfo,
00372 const GR_DisplayOption &drawOpt,
00373 float lod, int &cullCount) const;
00374 int shadedDrawPrimitives(GU_Detail *gdp, RE_Render &ren,
00375 const GR_DisplayOption &drawopt,
00376 int drawselect,
00377 const GR_AttribOffset &ptInfo,
00378 float lod = 1,
00379 const GU_PrimGroupClosure *hidden_geometry = 0,
00380 float t = 0,
00381 int textureTransparent = 0) const;
00382 int shadedDrawPrimitives(GU_Detail *gdp, RE_Render &ren,
00383 const GR_DisplayOption &drawopt,
00384 int drawselect,
00385 const GR_AttribOffset &ptInfo,
00386 float lod,
00387 const GU_PrimGroupClosure *hidden_geometry,
00388 float t,
00389 int textureTransparent,
00390 int &cullCount) const;
00391
00392
00393
00394
00395
00396
00397 void drawPrimNumbers(GU_Detail *gdp, RE_Render &ren,
00398 const GR_DisplayOption &drawopt,
00399 int drawselect,
00400 const GU_PrimGroupClosure *hidden_geometry=0)
00401 const;
00402 void drawPrimNormals(GU_Detail *gdp, RE_Render &ren,
00403 const GR_DisplayOption &drawopt,
00404 int drawselect,
00405 const GU_PrimGroupClosure *hidden_geometry=0)
00406 const;
00407 void drawPrimitiveNormal(RE_Render &ren, const GEO_Primitive *prim,
00408 const GR_DisplayOption &drawOpt) const;
00409 void drawProfNumbers(GU_Detail *gdp, RE_Render &ren,
00410 const GR_DisplayOption &drawopt,
00411 int drawselect,
00412 const GU_PrimGroupClosure *hidden_geometry=0)
00413 const;
00414
00415 void drawVertexAttributes(GU_Detail *gdp, RE_Render &ren,
00416 const GR_DisplayOption &drawopt,
00417 int drawselect,
00418 const GU_PrimGroupClosure *hidden_geometry = 0,
00419 int txtOff=-1, int yoff=0) const;
00420
00421 void drawPoints(GU_Detail *gdp, RE_Render &ren,
00422 const GR_DisplayOption &drawopt,
00423 int drawselect,
00424 const GU_PrimGroupClosure *hidden_geometry)
00425 const;
00426
00427 void drawPointAttributes(GU_Detail *gdp, RE_Render &ren,
00428 const GR_DisplayOption &drawopt,
00429 int drawselect,
00430 const GU_PrimGroupClosure *hidden_geometry,
00431 int txtOff=-1, int yoff=0) const;
00432
00433 void drawPointNormals(GU_Detail *gdp, RE_Render &ren,
00434 const GR_DisplayOption &drawopt,
00435 int drawselect,
00436 const GU_PrimGroupClosure *hidden_geometry,
00437 int nmlOff) const;
00438
00439 void drawUserDecorations(GU_Detail *gdp, RE_Render &ren,
00440 const GR_AttribOffset &info,
00441 const GR_DisplayOption &drawopt,
00442 int drawselect,
00443 const GU_PrimGroupClosure *hidden_geometry)
00444 const;
00445
00446 void drawPointDecorations(GU_Detail *gdp, RE_Render &ren,
00447 const GR_AttribOffset &info,
00448 const GR_DisplayOption &drawopt,
00449 int drawselect,
00450 const GU_PrimGroupClosure *hidden_geometry,
00451 const GR_DecorationList &) const;
00452 void drawVertexDecorations(GU_Detail *gdp, RE_Render &ren,
00453 const GR_AttribOffset &info,
00454 const GR_DisplayOption &drawopt,
00455 int drawselect,
00456 const GU_PrimGroupClosure *hidden_geometry,
00457 const GR_DecorationList &) const;
00458 void drawPrimDecorations(GU_Detail *gdp, RE_Render &ren,
00459 const GR_AttribOffset &info,
00460 const GR_DisplayOption &drawopt,
00461 int drawselect,
00462 const GU_PrimGroupClosure *hidden_geometry,
00463 const GR_DecorationList &) const;
00464
00465 void drawGreville(GU_TPSurf *tpsurf, RE_Render &ren) const;
00466 void drawHull(const GU_TPSurf *tpsurf, RE_Render &ren,
00467 const UT_Color &clr) const;
00468 void drawHull(const GU_PrimTriBezier *tpsurf, RE_Render &ren,
00469 const UT_Color &clr) const;
00470 void drawHull(const GU_PrimVolume *volume, RE_Render &ren,
00471 const UT_Color &clr) const;
00472
00473 inline void drawPointSelection(GU_Detail *gdp, GU_Selection *selection,
00474 const GR_DisplayOption &drawOpt,
00475 RE_Render &ren,
00476 const GU_PrimGroupClosure *hidden_geometry,
00477 const UT_Color &selcolor) const;
00478 inline void wireDrawNonSelectedPrim(GU_Detail *gdp, GEO_Primitive *prim,
00479 RE_Render &ren,
00480 const GR_AttribOffset &ptinfo, float lod,
00481 const GU_PrimGroupClosure *hidden_geometry,
00482 GR_DisplayOption *dopt, int drawselect,
00483 int profflag, int &cullCount) const;
00484 inline void wireDrawPrimSelection(GU_Detail *gdp, GU_Selection *selection,
00485 GR_DisplayOption &drawOpt,
00486 const GR_AttribOffset &ptinfo,
00487 RE_Render &ren, float lod,
00488 int &cullCount,
00489 const GU_PrimGroupClosure *hidden_geometry,
00490 const UT_Color &selcolor) const;
00491
00492 inline void drawSelectionPrimitiveNormals(GU_Detail *gdp,
00493 GU_Selection *selection,
00494 RE_Render &ren,
00495 const GU_PrimGroupClosure *hidden_geometry,
00496 const GR_DisplayOption &drawOpt) const;
00497 inline void shadedDrawPrimSelection(GU_Detail *gdp,
00498 GU_Selection *selection,
00499 RE_Render &ren,
00500 const GU_PrimGroupClosure *hidden_geometry,
00501 float lod, int solidonly_flag,
00502 const GR_DisplayOption &drawOpt,
00503 const GR_AttribOffset &ptinfo,
00504 int &cullCount,
00505 const UT_Color &selcolor,
00506 int &skipped_transparent) const;
00507
00508 void wireDrawPrimitivesOverShaded(GU_Detail *gdp, RE_Render &ren,
00509 const GR_DisplayOption &drawopt,
00510 int drawselect,
00511 GR_AttribOffset &ptInfo,
00512 const GU_PrimGroupClosure *hidden_geometry,
00513 float lod = 1) const;
00514
00515 void drawDecorationsOverShaded(GU_Detail *gdp, RE_Render &ren,
00516 const GR_DisplayOption &drawopt,
00517 int drawselect,
00518 const GR_AttribOffset &ptInfo,
00519 bool allattribs,
00520 const GU_PrimGroupClosure *hidden_geometry)
00521 const;
00522
00523
00524
00525
00526 void getSelPrimColor(int sel_index, UT_Color &color,
00527 const GR_DisplayOption &drawOpt) const;
00528 void getSelPointColor(int sel_index, UT_Color &color,
00529 const GR_DisplayOption &drawOpt) const;
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540 void wirePickPrimitives(GU_Detail *gdp, RE_Render &ren,
00541 const GR_DisplayOption &drawOpt,
00542 int drawselect,
00543 const GR_AttribOffset &ptInfo,
00544 const GU_PrimGroupClosure *hidden_geometry,
00545 float lod = 1.0f) const;
00546 void shadedPickPrimitives(GU_Detail *gdp, RE_Render &ren,
00547 const GR_DisplayOption &drawOpt,
00548 int drawselect,
00549 const GR_AttribOffset &ptInfo,
00550 const GU_PrimGroupClosure *hidden_geometry,
00551 float lod = 1.0f) const;
00552
00553 void pickPoints(GU_Detail *gdp, RE_Render &ren,
00554 const GR_DisplayOption &drawopt,
00555 int drawselect,
00556 const GU_PrimGroupClosure *hidden_geometry)
00557 const;
00558
00559 void pickVertices(GU_Detail *gdp, RE_Render &ren,
00560 const GR_DisplayOption &drawopt,
00561 int drawselect,
00562 const GU_PrimGroupClosure *hidden_geometry)
00563 const;
00564 void pickPointNormals(GU_Detail *gdp, RE_Render &ren,
00565 const GR_DisplayOption &drawopt,
00566 int drawselect,
00567 const GU_PrimGroupClosure *hidden_geometry)
00568 const;
00569
00570 void pickFaceEdges(const GEO_Face *face, RE_Render &ren,
00571 GB_PointGroup *ptGroup = 0) const;
00572 void pickHullEdges(const GEO_Hull *hull, RE_Render &ren,
00573 GB_PointGroup *ptGroup = 0) const;
00574
00575 void pickEdgeMidpoints(const GEO_Face *face, RE_Render &ren,
00576 GB_PointGroup *ptGroup = 0) const;
00577 void pickHullEdgeMidpoints(const GEO_Hull *hull, RE_Render &ren,
00578 GB_PointGroup *ptGroup = 0) const;
00579 void pickHullPointsRowCol(const GEO_Hull *mesh,
00580 RE_Render &ren) const;
00581 inline void wirePickSelectionPrimitives(GU_Detail *gdp,
00582 GU_Selection *selection,
00583 const GR_DisplayOption &drawOpt,
00584 RE_Render &ren,
00585 const GR_AttribOffset &ptinfo,
00586 float lod, int &cullCount,
00587 const GU_PrimGroupClosure *hidden_geometry)
00588 const;
00589 inline void shadedPickSelectionPrimitives(GU_Detail *gdp,
00590 GU_Selection *selection,
00591 const GR_DisplayOption &drawOpt,
00592 RE_Render &ren,
00593 const GR_AttribOffset &ptinfo,
00594 float lod, int &cullCount,
00595 const GU_PrimGroupClosure *hidden_geometry)
00596 const;
00597
00598
00599
00600
00601
00602
00603 void circleWireDraw(const GU_PrimCircle *circle, RE_Render &ren,
00604 const GR_AttribOffset &ptInfo,
00605 const GR_DisplayOption &drawOpt,
00606 float lod) const;
00607 void circleShadedDraw(const GU_PrimCircle *circle, RE_Render &ren,
00608 const GR_AttribOffset &ptInfo,
00609 const GR_DisplayOption &drawOpt,
00610 float lod) const;
00611 void circleWirePick(const GU_PrimCircle *circle, RE_Render &ren,
00612 const GR_AttribOffset &ptInfo,
00613 const GR_DisplayOption &drawOpt,
00614 float lod) const;
00615 void circleShadedPick(const GU_PrimCircle *circle, RE_Render &ren,
00616 const GR_AttribOffset &ptInfo,
00617 const GR_DisplayOption &drawOpt,
00618 float lod) const;
00619
00620
00621 void curveWireDraw(GU_Curve *curve, RE_Render &ren,
00622 const GR_AttribOffset &ptInfo,
00623 const GR_DisplayOption &drawOpt,
00624 float lod, int pick = 0,
00625 bool lighting = false) const;
00626 void curveShadedDraw(GU_Curve *curve, RE_Render &ren,
00627 const GR_AttribOffset &ptInfo,
00628 const GR_DisplayOption &drawOpt,
00629 float lod, int pick = 0) const;
00630 void curveWirePick(GU_Curve *curve, RE_Render &ren,
00631 const GR_AttribOffset &ptInfo,
00632 const GR_DisplayOption &drawOpt,
00633 float lod) const;
00634 void curveShadedPick(GU_Curve *curve, RE_Render &ren,
00635 const GR_AttribOffset &ptInfo,
00636 const GR_DisplayOption &drawOpt,
00637 float lod) const;
00638
00639
00640 void meshWireDraw(const GU_PrimMesh *mesh, RE_Render &ren,
00641 const GR_AttribOffset &ptInfo,
00642 const GR_DisplayOption &drawOpt,
00643 int &count) const;
00644 void meshShadedDraw(const GU_PrimMesh *mesh, RE_Render &ren,
00645 const GR_AttribOffset &ptInfo,
00646 const GR_DisplayOption &drawOpt,
00647 int &count) const;
00648 void meshWirePick(const GU_PrimMesh *mesh, RE_Render &ren,
00649 const GR_AttribOffset &ptInfo,
00650 const GR_DisplayOption &drawopt,
00651 int &count) const;
00652 void meshShadedPick(const GU_PrimMesh *mesh, RE_Render &ren,
00653 const GR_AttribOffset &ptInfo,
00654 const GR_DisplayOption &drawopt,
00655 int &count) const;
00656
00657
00658 void tribezWireDraw(const GU_PrimTriBezier *tribez, RE_Render &ren,
00659 const GR_AttribOffset &ptInfo,
00660 const GR_DisplayOption &drawOpt, float lod,
00661 int &count) const;
00662 void tribezShadedDraw(const GU_PrimTriBezier *tribez, RE_Render &ren,
00663 const GR_AttribOffset &ptInfo,
00664 const GR_DisplayOption &drawOpt, float lod,
00665 int &count) const;
00666 void tribezWirePick(const GU_PrimTriBezier *tribez, RE_Render &ren,
00667 const GR_AttribOffset &ptInfo,
00668 const GR_DisplayOption &drawopt,
00669 float lod,
00670 int &count) const;
00671 void tribezShadedPick(const GU_PrimTriBezier *tribez, RE_Render &ren,
00672 const GR_AttribOffset &ptInfo,
00673 const GR_DisplayOption &drawopt,
00674 float lod,
00675 int &count) const;
00676
00677
00678 void volumeWireDraw(const GU_PrimVolume *volume, RE_Render &ren,
00679 const GR_AttribOffset &ptInfo,
00680 const GR_DisplayOption &drawOpt, float lod,
00681 int &count) const;
00682 void volumeShadedDraw(const GU_PrimVolume *volume, RE_Render &ren,
00683 const GR_AttribOffset &ptInfo,
00684 const GR_DisplayOption &drawOpt, float lod,
00685 int &count) const;
00686 void volumeWirePick(const GU_PrimVolume *volume, RE_Render &ren,
00687 const GR_AttribOffset &ptInfo,
00688 const GR_DisplayOption &drawopt,
00689 float lod,
00690 int &count) const;
00691 void volumeShadedPick(const GU_PrimVolume *volume, RE_Render &ren,
00692 const GR_AttribOffset &ptInfo,
00693 const GR_DisplayOption &drawopt,
00694 float lod,
00695 int &count) const;
00696
00697
00698 void trifanWireDraw(const GU_PrimTriFan *trifan, RE_Render &ren,
00699 const GR_AttribOffset &ptInfo,
00700 const GR_DisplayOption &drawOpt,
00701 int &count) const;
00702 void trifanShadedDraw(const GU_PrimTriFan *trifan, RE_Render &ren,
00703 const GR_AttribOffset &ptInfo,
00704 const GR_DisplayOption &drawOpt,
00705 int &count) const;
00706 void trifanWirePick(const GU_PrimTriFan *trifan, RE_Render &ren,
00707 const GR_AttribOffset &ptInfo,
00708 const GR_DisplayOption &drawopt,
00709 int &count) const;
00710 void trifanShadedPick(const GU_PrimTriFan *trifan, RE_Render &ren,
00711 const GR_AttribOffset &ptInfo,
00712 const GR_DisplayOption &drawopt,
00713 int &count) const;
00714
00715
00716 void tristripWireDraw(const GU_PrimTriStrip *tristrip,
00717 RE_Render &ren,
00718 const GR_AttribOffset &ptInfo,
00719 const GR_DisplayOption &drawOpt,
00720 int &count) const;
00721 void tristripShadedDraw(const GU_PrimTriStrip *tristrip,
00722 RE_Render &ren,
00723 const GR_AttribOffset &ptInfo,
00724 const GR_DisplayOption &drawOpt,
00725 int &count) const;
00726 void tristripWirePick(const GU_PrimTriStrip *tristrip,
00727 RE_Render &ren,
00728 const GR_AttribOffset &ptInfo,
00729 const GR_DisplayOption &drawopt,
00730 int &count) const;
00731 void tristripShadedPick(const GU_PrimTriStrip *tristrip,
00732 RE_Render &ren,
00733 const GR_AttribOffset &ptInfo,
00734 const GR_DisplayOption &drawopt,
00735 int &count) const;
00736
00737
00738 void particleWireDraw(const GU_PrimParticle *part, RE_Render &ren,
00739 const GR_AttribOffset &ptInfo,
00740 const GR_DisplayOption &drawOpt,
00741 int &count, int adjust_shading) const;
00742 void particleShadedDraw(const GU_PrimParticle *part, RE_Render &ren,
00743 const GR_AttribOffset &ptInfo,
00744 const GR_DisplayOption &drawOpt,
00745 int &count) const;
00746 void spriteWireDraw(const GU_PrimParticle *part, RE_Render &ren,
00747 const GR_AttribOffset &ptInfo,
00748 const GR_DisplayOption &drawOpt,
00749 int &count) const;
00750 void spriteShadedDraw(const GU_PrimParticle *part, RE_Render &ren,
00751 const GR_AttribOffset &ptInfo,
00752 const GR_DisplayOption &drawOpt,
00753 int &count, float t,
00754 OP_Node *shopsRelativeTo) const;
00755 void spriteTextureShadedDraw(const GU_PrimParticle *part,
00756 RE_Render &ren,
00757 const GR_AttribOffset &ptInfo,
00758 const GR_DisplayOption &drawOpt,
00759 int &count, float t,
00760 OP_Node *shopsRelativeTo) const;
00761 void particleWirePick(const GU_PrimParticle *part, RE_Render &ren,
00762 const GR_AttribOffset &ptInfo,
00763 const GR_DisplayOption &drawopt,
00764 int &count) const;
00765 void particleShadedPick(const GU_PrimParticle *part, RE_Render &ren,
00766 const GR_AttribOffset &ptInfo,
00767 const GR_DisplayOption &drawopt,
00768 int &count) const;
00769
00770
00771 void polygonWireDraw(const GU_PrimPoly *poly, RE_Render &ren,
00772 const GR_AttribOffset &ptInfo,
00773 const GR_DisplayOption &drawOpt,
00774 bool lighting = false) const;
00775 void polygonShadedDraw(const GU_PrimPoly *poly, RE_Render &ren,
00776 const GR_AttribOffset &ptInfo,
00777 const GR_DisplayOption &drawOpt) const;
00778 void polygonWirePick(const GU_PrimPoly *poly, RE_Render &ren,
00779 const GR_DisplayOption &drawOpt) const;
00780 void polygonShadedPick(const GU_PrimPoly *poly, RE_Render &ren,
00781 const GR_DisplayOption &drawOpt) const;
00782
00783
00784 void metaballWireDraw(const GU_PrimMetaBall *prim, RE_Render &ren,
00785 const GR_DisplayOption &drawOpt,
00786 float lod) const;
00787 void metaballShadedDraw(const GU_PrimMetaBall *prim, RE_Render &ren,
00788 const GR_DisplayOption &drawOpt,
00789 float lod) const;
00790 void metaballWirePick(const GU_PrimMetaBall *prim, RE_Render &ren,
00791 const GR_DisplayOption &drawOpt,
00792 float lod) const;
00793 void metaballShadedPick(const GU_PrimMetaBall *prim, RE_Render &ren,
00794 const GR_DisplayOption &drawOpt,
00795 float lod) const;
00796
00797
00798 void metasquadWireDraw(const GU_PrimMetaSQuad *prim, RE_Render &ren,
00799 const GR_DisplayOption &drawOpt,
00800 float lod) const;
00801 void metasquadShadedDraw(const GU_PrimMetaSQuad *p, RE_Render &ren,
00802 const GR_DisplayOption &drawOpt,
00803 float lod) const;
00804 void metasquadWirePick(const GU_PrimMetaSQuad *prim, RE_Render &ren,
00805 const GR_DisplayOption &drawOpt,
00806 float lod) const;
00807 void metasquadShadedPick(const GU_PrimMetaSQuad *prim,
00808 RE_Render &ren,
00809 const GR_DisplayOption &drawOpt,
00810 float lod) const;
00811
00812
00813 static void bootstrapSphereObjects(RE_Render &ren);
00814
00815 void sphereWireDraw(const GU_PrimSphere *sphere, RE_Render &ren,
00816 const GR_AttribOffset &ptInfo,
00817 const GR_DisplayOption &drawOpt,
00818 float lod) const;
00819 void sphereShadedDraw(const GU_PrimSphere *sphere, RE_Render &ren,
00820 const GR_AttribOffset &ptInfo,
00821 const GR_DisplayOption &drawOpt,
00822 float lod) const;
00823 void sphereWirePick(const GU_PrimSphere *sphere, RE_Render &ren,
00824 const GR_AttribOffset &ptInfo,
00825 const GR_DisplayOption &drawOpt,
00826 float lod) const;
00827 void sphereShadedPick(const GU_PrimSphere *sphere, RE_Render &ren,
00828 const GR_AttribOffset &ptInfo,
00829 const GR_DisplayOption &drawOpt,
00830 float lod) const;
00831
00832
00833 void tpsurfWireDraw(GU_TPSurf *tpsurf, RE_Render &ren,
00834 const GR_AttribOffset &ptInfo,
00835 const GR_DisplayOption &drawOpt,
00836 float lod, int &count,
00837 int pick = 0) const;
00838 void tpsurfWireDraw(GU_TPSurf *tpsurf, GB_Primitive *prof,
00839 RE_Render &ren,
00840 const GR_AttribOffset &ptInfo,
00841 const GR_DisplayOption &drawOpt,
00842 float lod, int &count, int
00843 pick = 0) const;
00844 void tpsurfShadedDraw(GU_TPSurf *tpsurf, RE_Render &ren,
00845 const GR_AttribOffset &ptInfo,
00846 const GR_DisplayOption &drawOpt,
00847 float lod, int &count,
00848 int pick = 0) const;
00849 void tpsurfWirePick(GU_TPSurf *tpsurf, RE_Render &ren,
00850 const GR_AttribOffset &ptInfo,
00851 const GR_DisplayOption &drawOpt,
00852 float lod, int &count) const;
00853 void tpsurfWirePick(GU_TPSurf *tpsurf, GB_Primitive *prof,
00854 RE_Render &ren,
00855 const GR_AttribOffset &ptInfo,
00856 const GR_DisplayOption &drawOpt,
00857 float lod, int &count) const;
00858 void tpsurfShadedPick(GU_TPSurf *tpsurf, RE_Render &ren,
00859 const GR_AttribOffset &ptInfo,
00860 const GR_DisplayOption &drawOpt,
00861 float lod, int &count) const;
00862
00863
00864 void tubeWireDraw(const GU_PrimTube *tube, RE_Render &ren,
00865 const GR_AttribOffset &ptInfo,
00866 const GR_DisplayOption &drawOpt,
00867 float lod) const;
00868 void tubeShadedDraw(const GU_PrimTube *tube, RE_Render &ren,
00869 const GR_AttribOffset &ptInfo,
00870 const GR_DisplayOption &drawOpt,
00871 float lod) const;
00872 void tubeWirePick(const GU_PrimTube *tube, RE_Render &ren,
00873 const GR_AttribOffset &ptInfo,
00874 const GR_DisplayOption &drawOpt,
00875 float lod) const;
00876 void tubeShadedPick(const GU_PrimTube *tube, RE_Render &ren,
00877 const GR_AttribOffset &ptInfo,
00878 const GR_DisplayOption &drawOpt,
00879 float lod) const;
00880
00881
00882 static GR_WRITE_VERTEX wireVertex;
00883 static GR_WRITE_VERTEX shadedVertex;
00884 static GR_WRITE_VERTEX flatShadedVertex;
00885
00886
00887
00888 static UT_Bool forceFastestShadedVertex;
00889
00890 void setForceFastestShadedVertex( UT_Bool yes ) const;
00891 UT_Bool getForceFastestShadedVertex() const
00892 { return forceFastestShadedVertex; };
00893
00894 void setWireVertex(int for_cache,
00895 const GR_AttribOffset &ptInfo) const;
00896 void setFastestWireVertex() const;
00897 void setShadedVertex(int for_cache,
00898 const GR_AttribOffset &ptInfo) const;
00899 void setFlatShadedVertex(int for_cache,
00900 const GR_AttribOffset &ptInfo) const;
00901 void setFastestShadedVertex() const;
00902
00903 bool pushVertexColor(RE_Render &ren, const GEO_Vertex &vtx,
00904 const GEO_Point *ppt,
00905 const GR_AttribOffset &info) const;
00906 bool pushVertexColorAlpha(RE_Render &ren, const GEO_Vertex &vtx,
00907 const GEO_Point *ppt,
00908 const GR_AttribOffset &info) const;
00909
00910
00911 void selectionWireDraw(const GU_Selection *selection, RE_Render &ren,
00912 const GR_DisplayOption &drawopt,
00913 int sel_index,
00914 const GU_PrimGroupClosure *hidden_geometry)
00915 const;
00916 void selectionShadedDraw(const GU_Selection *selection,
00917 RE_Render &ren,
00918 const GR_DisplayOption &drawopt,
00919 int sel_index,
00920 const GU_PrimGroupClosure *hidden_geometry)
00921 const;
00922 void edgeSelectionWireDraw(const GU_EdgeSelection *edgeSelection,
00923 RE_Render &ren,
00924 const GR_DisplayOption &drawopt,
00925 int sel_index,
00926 const GU_PrimGroupClosure *hidden_geometry)
00927 const;
00928 void vertexSelectionWireDraw(const GU_VertexSelection *vtxSelection,
00929 RE_Render &ren,
00930 const GR_DisplayOption &drawopt,
00931 int sel_index,
00932 const GU_PrimGroupClosure
00933 *hidden_geometry ) const;
00934
00935 void breakpointSelectionWireDraw(
00936 const GU_BreakpointSelection *bkpSelection,
00937 RE_Render &ren, const GR_DisplayOption &drawopt,
00938 int sel_index,
00939 const GU_PrimGroupClosure *hidden_geometry) const;
00940
00941
00942 void pushQuadricXform(RE_Render &ren, const GEO_Quadric &q) const;
00943 void pushQuadricXform(RE_Render &ren,
00944 float tx, float ty, float tz,
00945 float rx, float ry, float rz,
00946 float sx, float sy, float sz,
00947 int pushScale = 0) const;
00948
00949 static void bootstrapCircleObjects(RE_Render &ren);
00950
00951 void wireXYCircle (RE_Render &ren, float lod) const;
00952 void shadedXYCircle(RE_Render &ren, float lod) const;
00953 void wireYZCircle (RE_Render &ren, float lod) const;
00954 void shadedYZCircle(RE_Render &ren, float lod) const;
00955 void wireXZCircle (RE_Render &ren, float lod) const;
00956 void shadedXZCircle(RE_Render &ren, float lod) const;
00957
00958
00959
00960 void wireXYHalfCircle (RE_Render &ren, float lod) const;
00961 void wireYZHalfCircle (RE_Render &ren, float lod) const;
00962 void wireXZHalfCircle (RE_Render &ren, float lod) const;
00963
00964
00965 unsigned bumpCullCount(const GR_DisplayOption &, int &) const;
00966
00967
00968 void initializeTubeDraw(const GU_PrimTube *tube,
00969 float taperx, float taperz,
00970 RE_Render &ren,
00971 float *xtopN, float *xtopP,
00972 float *ztopN, float *ztopP,
00973 float *xmidN, float *xmidP,
00974 float *zmidN, float *zmidP) const;
00975
00976
00977 int pushPrimColor(const GEO_Primitive *prim, RE_Render &ren,
00978 const GR_AttribOffset &ptinfo,
00979 const GR_DisplayOption &dopt) const;
00980
00981
00982
00983
00984
00985
00986 int primShadedNoMaterial(GU_Detail *gdp, RE_Render &ren,
00987 const GR_DisplayOption &drawOpt,
00988 int drawselect,
00989 const GR_AttribOffset &ptinfo, float lod,
00990 const GU_PrimGroupClosure *hidden_geometry,
00991 int skipmaterials,
00992 int textureTransparent,
00993 gr_PrimMaterial &pmat,
00994 int &cullCount) const;
00995
00996 int primShadedMaterial(GU_Detail *gdp, RE_Render &ren,
00997 const GR_DisplayOption &drawOpt,
00998 int drawselect,
00999 const GR_AttribOffset &ptinfo, float lod,
01000 const GU_PrimGroupClosure *hidden_geometry,
01001 float t, gr_PrimMaterial &pmat,
01002 int &cullCount) const;
01003
01004 const GU_SelectionList &getSelectionList(GU_Detail &gdp,
01005 const GR_DisplayOption &drawOpt) const;
01006
01007 static bool theVertexDiffuseMaterialFlag;
01008 };
01009
01010 #endif