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

SoSTLFileKit.h
1 #ifndef COIN_SOSTLFILEKIT_H
2 #define COIN_SOSTLFILEKIT_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/SbBasic.h>
28 
29 #include <Inventor/fields/SoSFString.h>
30 #include <Inventor/fields/SoSFBool.h>
31 #include <Inventor/fields/SoSFEnum.h>
32 
33 #include <ForeignFiles/SoForeignFileKit.h>
34 
35 class SbVec3f;
36 class SoCallbackAction;
37 class SoPrimitiveVertex;
38 class SoSTLFileKitP;
39 
40 class COIN_DLL_API SoSTLFileKit : public SoForeignFileKit {
42 
43  SO_KIT_HEADER(SoSTLFileKit);
44  SO_KIT_CATALOG_ENTRY_HEADER(shapehints);
45  SO_KIT_CATALOG_ENTRY_HEADER(texture);
46  SO_KIT_CATALOG_ENTRY_HEADER(normalbinding);
47  SO_KIT_CATALOG_ENTRY_HEADER(normals);
48  SO_KIT_CATALOG_ENTRY_HEADER(materialbinding);
49  SO_KIT_CATALOG_ENTRY_HEADER(material);
50  SO_KIT_CATALOG_ENTRY_HEADER(coordinates);
51  SO_KIT_CATALOG_ENTRY_HEADER(facets);
52 
53 public:
54  static void initClass(void);
55  SoSTLFileKit(void);
56 
57  enum Colorization { GREY, MATERIALISE, TNO_VISICAM };
58 
59  SoSFString info;
60  SoSFBool binary;
61  SoSFEnum colorization;
62 
63  static SbBool identify(const char * filename);
64  virtual SbBool canReadFile(const char * filename = NULL) const;
65  virtual SbBool readFile(const char * filename);
66  virtual SbBool canReadScene(void) const;
67  virtual SbBool readScene(SoNode * scene);
68 
69  virtual SbBool canWriteFile(const char * filename = NULL) const;
70  virtual SbBool writeFile(const char * filename);
71  virtual SbBool canWriteScene(const char * format = NULL) const;
72  virtual SbBool writeScene(SoNode *& root, const char * format = NULL);
73 
74 protected:
75  virtual ~SoSTLFileKit(void);
76 
77  void reset(void);
78  SbBool addFacet(const SbVec3f & v1, const SbVec3f & v2, const SbVec3f & v3,
79  const SbVec3f & normal);
80  void organizeModel(void);
81 
82 private:
83  SoSTLFileKitP * pimpl;
84 
85  static void add_facet_cb(void * closure, SoCallbackAction * action, const SoPrimitiveVertex * v1, const SoPrimitiveVertex * v2, const SoPrimitiveVertex * v3);
86  static void put_facet_cb(void * closure, SoCallbackAction * action, const SoPrimitiveVertex * v1, const SoPrimitiveVertex * v2, const SoPrimitiveVertex * v3);
87 
88 }; // SoSTLFileKit
89 
90 #endif // !COIN_SOSTLFILEKIT_H
The SoBaseKit class is the toplevel superclass for nodekits.Node kits are collections of nodes and ot...
Definition: SoBaseKit.h:57
Abstract base class for foreign file format support in Coin.
Definition: SoForeignFileKit.h:38
The SoPrimitiveVertex class represents a single vertex of a generated primitive.Instances of SoPrimit...
Definition: SoPrimitiveVertex.h:34
The SoSFString class is a container for an SbString.This field is used where nodes, engines or other field containers needs to store a single string.
Definition: SoSFString.h:31
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 SoSFEnum class is a container for an enum value.This field is used where nodes, engines or other field containers needs to store one particular value out of an enumerated set.
Definition: SoSFEnum.h:31
SoSTLFileKit is a class for using STL files with Coin.
Definition: SoSTLFileKit.h:40
The SoSFBool class is a container for an SbBool value.This field is used where nodes, engines or other field containers needs to store a boolean on/off or TRUE/FALSE value, like for instance as the "on" field of the SoPointLight, SoSpotLight and SoDirectionalLight node classes.
Definition: SoSFBool.h:30
The SbVec3f class is a 3 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec3f.h:40
The SoCallbackAction class invokes callbacks at specific nodes.This action has mechanisms for trackin...
Definition: SoCallbackAction.h:71

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

Generated on Wed Feb 7 2018 for Coin by Doxygen 1.8.14.