Coin Logo http://www.sim.no/
http://www.coin3d.org/

SoGetPrimitiveCountAction.h
1 #ifndef COIN_SOGETPRIMITIVECOUNTACTION_H
2 #define COIN_SOGETPRIMITIVECOUNTACTION_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) by Kongsberg Oil & Gas Technologies.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using Coin with software that can not be combined with the GNU
16  * GPL, and for taking advantage of the additional benefits of our
17  * support services, please contact Kongsberg Oil & Gas Technologies
18  * about acquiring a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <Inventor/actions/SoAction.h>
28 #include <Inventor/actions/SoSubAction.h>
29 #include <Inventor/tools/SbLazyPimplPtr.h>
30 #include <Inventor/elements/SoDecimationTypeElement.h>
31 
32 class SoGetPrimitiveCountActionP;
33 
34 class COIN_DLL_API SoGetPrimitiveCountAction : public SoAction {
35  typedef SoAction inherited;
36 
37  SO_ACTION_HEADER(SoGetPrimitiveCountAction);
38 
39 public:
40  static void initClass(void);
41 
43  virtual ~SoGetPrimitiveCountAction(void);
44 
45  int getTriangleCount(void) const;
46  int getLineCount(void) const;
47  int getPointCount(void) const;
48  int getTextCount(void) const;
49  int getImageCount(void) const;
50  SbBool containsNoPrimitives(void);
51  SbBool containsNonTriangleShapes(void);
52 
53  SbBool is3DTextCountedAsTriangles(void);
54  void setCount3DTextAsTriangles(const SbBool flag);
55 
56  SbBool canApproximateCount(void);
57  void setCanApproximate(const SbBool flag);
58 
59  void setDecimationValue(SoDecimationTypeElement::Type type,
60  float percentage = 1.0);
61  SoDecimationTypeElement::Type getDecimationType(void);
62  float getDecimationPercentage(void);
63 
64  void addNumTriangles(const int num);
65  void addNumLines(const int num);
66  void addNumPoints(const int num);
67  void addNumText(const int num);
68  void addNumImage(const int num);
69  void incNumTriangles(void);
70  void incNumLines(void);
71  void incNumPoints(void);
72  void incNumText(void);
73  void incNumImage(void);
74 
75 protected:
76  virtual void beginTraversal(SoNode * node);
77 
78 private:
79  int numtris;
80  int numlines;
81  int numpoints;
82  int numtexts;
83  int numimages;
84 
85  SbBool textastris;
86  SbBool approx;
87  SbBool nonvertexastris;
88  SoDecimationTypeElement::Type decimationtype;
89  float decimationpercentage;
90 
91 private:
92  SbLazyPimplPtr<SoGetPrimitiveCountActionP> pimpl;
93 
94  // NOT IMPLEMENTED:
96  SoGetPrimitiveCountAction & operator = (const SoGetPrimitiveCountAction & rhs);
97 }; // SoGetPrimitiveCountAction
98 
99 #endif // !COIN_SOGETPRIMITIVECOUNTACTION_H
static void initClass(void)
Definition: SoAction.cpp:366
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
The SoAction class is the base class for all traversal actions.Applying actions is the basic mechanis...
Definition: SoAction.h:68
Type
Definition: SoDecimationTypeElement.h:39
The SoGetPrimitiveCountAction class counts the primitives in a scene.Apply this action to a scene if ...
Definition: SoGetPrimitiveCountAction.h:34
virtual void beginTraversal(SoNode *node)
Definition: SoAction.cpp:1263

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Fri Sep 9 2016 for Coin by Doxygen 1.8.5.