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) 1998-2007 by Systems in Motion. All rights reserved.
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 Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, 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/elements/SoDecimationTypeElement.h>
30 
31 
32 class COIN_DLL_API SoGetPrimitiveCountAction : public SoAction {
33  typedef SoAction inherited;
34 
35  SO_ACTION_HEADER(SoGetPrimitiveCountAction);
36 
37 public:
39  virtual ~SoGetPrimitiveCountAction();
40 
41  static void initClass(void);
42 
43  int getTriangleCount(void) const;
44  int getLineCount(void) const;
45  int getPointCount(void) const;
46  int getTextCount(void) const;
47  int getImageCount(void) const;
48  SbBool containsNoPrimitives(void);
49  SbBool containsNonTriangleShapes(void);
50 
51  SbBool is3DTextCountedAsTriangles(void);
52  void setCount3DTextAsTriangles(const SbBool flag);
53 
54  SbBool canApproximateCount(void);
55  void setCanApproximate(const SbBool flag);
56 
57  void setDecimationValue(SoDecimationTypeElement::Type type,
58  float percentage = 1.0);
59  SoDecimationTypeElement::Type getDecimationType(void);
60  float getDecimationPercentage(void);
61 
62  void addNumTriangles(const int num);
63  void addNumLines(const int num);
64  void addNumPoints(const int num);
65  void addNumText(const int num);
66  void addNumImage(const int num);
67  void incNumTriangles(void);
68  void incNumLines(void);
69  void incNumPoints(void);
70  void incNumText(void);
71  void incNumImage(void);
72 
73 protected:
74  virtual void beginTraversal(SoNode * node);
75 
76 private:
77  int numtris;
78  int numlines;
79  int numpoints;
80  int numtexts;
81  int numimages;
82 
83  SbBool textastris;
84  SbBool approx;
85  SbBool nonvertexastris;
86  SoDecimationTypeElement::Type decimationtype;
87  float decimationpercentage;
88 };
89 
90 #endif // !COIN_SOGETPRIMITIVECOUNTACTION_H
static void initClass(void)
Definition: SoAction.cpp:392
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:67
The SoGetPrimitiveCountAction class counts the primitives in a scene.Apply this action to a scene if ...
Definition: SoGetPrimitiveCountAction.h:32
virtual void beginTraversal(SoNode *node)
Definition: SoAction.cpp:1208

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Fri Jul 20 2018 for Coin by Doxygen. 1.8.14