H3D API  2.4.1
ImageObjectInfo.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
27 //
29 #ifndef __IMAGEOBJECTINFO_H__
30 #define __IMAGEOBJECTINFO_H__
31 
32 #include <H3D/H3DImageObject.h>
33 #include <H3D/X3DChildNode.h>
34 #include <H3D/SFInt32.h>
35 #include <H3D/SFVec3f.h>
36 #include <H3D/PeriodicUpdate.h>
37 #include <H3D/X3DTexture3DNode.h>
38 
39 namespace H3D {
48  class H3DAPI_API ImageObjectInfo : public X3DChildNode {
49  public:
50 
53  class H3DAPI_API SFImageObjectNode : public DependentSFNodeObject< H3DImageObject,
54  FieldRef< H3DImageObject,
55  H3DImageObject::SFImage,
56  &H3DImageObject::image >,
57  true > {
62  true > SFImageObjectNodeBase;
63  protected:
65  virtual void onAdd( Node *n );
66  };
67 
70  class H3DAPI_API UpdateFields: public PeriodicUpdate< SFImageObjectNode > {
71  protected:
72  virtual void update();
73  };
74 
75  ImageObjectInfo( Inst< SFImageObjectNode > _texture = 0,
76  Inst< SFVec3f > _pixelSize = 0,
77  Inst< SFInt32 > _width = 0,
78  Inst< SFInt32 > _height = 0,
79  Inst< SFInt32 > _depth = 0,
80  Inst< SFString > _pixelType = 0,
81  Inst< SFString > _pixelComponentType = 0,
82  Inst< SFInt32 > _bitsPerPixel = 0,
83  Inst< SFVec3f > _totalSize = 0 );
84 
89  H3DUniquePtr< SFImageObjectNode > texture;
90 
94  H3DUniquePtr< SFVec3f > pixelSize;
95 
99  H3DUniquePtr< SFInt32 > width;
100 
104  H3DUniquePtr< SFInt32 > height;
105 
109  H3DUniquePtr< SFInt32 > depth;
110 
121  H3DUniquePtr< SFString > pixelType;
122 
129  H3DUniquePtr< SFString > pixelComponentType;
130 
134  H3DUniquePtr< SFInt32 > bitsPerPixel;
135 
142  H3DUniquePtr< SFVec3f > totalSize;
143 
146  protected:
148  H3DUniquePtr< UpdateFields > update_fields;
149 
150  void updateFieldsFromImage( Image * image );
151 
152  };
153 }
154 
155 #endif
Header file for H3DImageObject, X3D abstract texture scene-graph node.
Header file for PeriodicUpdate, template field modifier.
Contains the SFInt32 field class.
Contains the SFVec3f field class.
Header file for X3DChildNode, X3D scene-graph node.
Header file for X3DTexture3DNode, X3D scene-graph node.
DependentSFNodeObject is similar to DependentSFNode but uses TypedSFNodeObject instead of TypedSFNode...
Definition: DependentNodeFields.h:377
Class used for specifying a field member of a node in a DependentSFNode or DependentMFNode specificat...
Definition: DependentNodeFields.h:48
The SFImage field is a field containing an Image pointer.
Definition: H3DImageObject.h:50
This abstract interface is inherited by all nodes that contains an SFImage object with an Image conta...
Definition: H3DImageObject.h:45
H3DUniquePtr< SFImage > image
Field containing the Image to use as a texture.
Definition: H3DImageObject.h:191
An SFNode where we make sure the type of the nodes contained is a subclass of H3DImageObject.
Definition: ImageObjectInfo.h:57
Field for updating the output fields when the image object changes value.
Definition: ImageObjectInfo.h:70
This node can be used to get information about dimensions, sizes pixel types etc from H3DImageObject ...
Definition: ImageObjectInfo.h:48
H3DUniquePtr< SFInt32 > height
The height of the image object in pixels.
Definition: ImageObjectInfo.h:104
H3DUniquePtr< UpdateFields > update_fields
The field used to update the other fields.
Definition: ImageObjectInfo.h:148
H3DUniquePtr< SFString > pixelComponentType
The type of each component of the pixel.
Definition: ImageObjectInfo.h:129
H3DUniquePtr< SFInt32 > bitsPerPixel
The number of bits used for each pixel.
Definition: ImageObjectInfo.h:134
H3DUniquePtr< SFVec3f > pixelSize
The size of each pixel/voxel in the image object in metres.
Definition: ImageObjectInfo.h:94
H3DUniquePtr< SFImageObjectNode > texture
The texture field contains the image object we want to get information from.
Definition: ImageObjectInfo.h:89
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: ImageObjectInfo.h:145
H3DUniquePtr< SFVec3f > totalSize
The total size of the volume in metres, i.e.
Definition: ImageObjectInfo.h:142
H3DUniquePtr< SFInt32 > depth
The depth of the image object in pixels.
Definition: ImageObjectInfo.h:109
H3DUniquePtr< SFString > pixelType
The type of each pixel element in the image object.
Definition: ImageObjectInfo.h:121
H3DUniquePtr< SFInt32 > width
The width of the image object in pixels.
Definition: ImageObjectInfo.h:99
Node is the base class for all classes that can be part of the H3D scene-graph.
Definition: Node.h:46
The PeriodicUpdate is a template modifier that changes the way the field is updated.
Definition: PeriodicUpdate.h:74
This abstract node type indicates that the concrete nodes which are instantiated based on it may be u...
Definition: X3DChildNode.h:42
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194