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
35class SbVec3f;
38class SoSTLFileKitP;
39
40class 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
53public:
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
74protected:
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
82private:
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 SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition SbVec3f.h:40
The SoCallbackAction class invokes callbacks at specific nodes.
Definition SoCallbackAction.h:71
Abstract base class for foreign file format support in Coin.
Definition SoForeignFileKit.h:38
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:47
The SoPrimitiveVertex class represents a single vertex of a generated primitive.
Definition SoPrimitiveVertex.h:34
The SoSFBool class is a container for an SbBool value.
Definition SoSFBool.h:30
The SoSFEnum class is a container for an enum value.
Definition SoSFEnum.h:31
The SoSFString class is a container for an SbString.
Definition SoSFString.h:31
SoSTLFileKit is a class for using STL files with Coin.
Definition SoSTLFileKit.h:40

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

Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.