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

SoOffscreenRenderer.h
1 #ifndef COIN_SOOFFSCREENRENDERER_H
2 #define COIN_SOOFFSCREENRENDERER_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/SbViewportRegion.h>
28 #include <Inventor/SbColor.h>
29 #include <Inventor/lists/SbList.h>
30 #include <Inventor/lists/SbPList.h>
31 #include <Inventor/SbString.h>
32 #include <Inventor/SbName.h>
33 
34 #include <stdio.h>
35 
36 class SoBase;
37 class SoGLRenderAction;
38 class SoNode;
39 class SoPath;
40 
41 // This shouldn't strictly be necessary, but the OSF1/cxx compiler
42 // complains if this is left out, while using the "friend class
43 // SoExtSelectionP" statement in the class definition.
44 class SoOffscreenRendererP;
45 
46 
47 class COIN_DLL_API SoOffscreenRenderer {
48 public:
49  enum Components {
50  LUMINANCE = 1,
51  LUMINANCE_TRANSPARENCY = 2,
52  RGB = 3,
53  RGB_TRANSPARENCY = 4
54  };
55 
56  SoOffscreenRenderer(const SbViewportRegion & viewportregion);
59 
60  static float getScreenPixelsPerInch(void);
61  static SbVec2s getMaximumResolution(void);
62  void setComponents(const Components components);
63  Components getComponents(void) const;
64  void setViewportRegion(const SbViewportRegion & region);
65  const SbViewportRegion & getViewportRegion(void) const;
66  void setBackgroundColor(const SbColor & color);
67  const SbColor & getBackgroundColor(void) const;
68  void setGLRenderAction(SoGLRenderAction * action);
69  SoGLRenderAction * getGLRenderAction(void) const;
70  SbBool render(SoNode * scene);
71  SbBool render(SoPath * scene);
72  unsigned char * getBuffer(void) const;
73 
74  SbBool writeToRGB(FILE * fp) const;
75  SbBool writeToPostScript(FILE * fp) const;
76  SbBool writeToPostScript(FILE * fp, const SbVec2f & printsize) const;
77 
78  SbBool writeToRGB(const char * filename) const;
79  SbBool writeToPostScript(const char * filename) const;
80  SbBool writeToPostScript(const char * filename, const SbVec2f & printsize) const;
81 
82  SbBool isWriteSupported(const SbName & filetypeextension) const;
83  int getNumWriteFiletypes(void) const;
84  void getWriteFiletypeInfo(const int idx,
85  SbPList & extlist,
86  SbString & fullname,
87  SbString & description);
88  SbBool writeToFile(const SbString & filename, const SbName & filetypeextension) const;
89 
90  // Please stop using this function. It will be removed in
91  // Coin 3.0. Use the SbPList version instead.
92  void getWriteFiletypeInfo(const int idx,
93  SbList <SbName> & extlist,
94  SbString & fullname,
95  SbString & description);
96 
97 private:
98  friend class SoOffscreenRendererP;
99  class SoOffscreenRendererP * pimpl;
100 };
101 
102 #endif // !COIN_SOOFFSCREENRENDERER_H
SoGLRenderAction::AbortCode
AbortCode
Definition: SoGLRenderAction.h:60
SoOffscreenRenderer::getBackgroundColor
const SbColor & getBackgroundColor(void) const
Definition: SoOffscreenRenderer.cpp:516
SoOffscreenRenderer::writeToFile
SbBool writeToFile(const SbString &filename, const SbName &filetypeextension) const
Definition: SoOffscreenRenderer.cpp:1411
SoState
The SoState class manages the Coin scenegraph traversal state data.
Definition: SoState.h:35
SoOffscreenRenderer::getNumWriteFiletypes
int getNumWriteFiletypes(void) const
Definition: SoOffscreenRenderer.cpp:1287
SbViewportRegion::getViewportSizePixels
const SbVec2s & getViewportSizePixels(void) const
Definition: SbViewportRegion.cpp:425
SbName
The SbName class stores strings by reference.
Definition: SbName.h:31
SbVec2f
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition: SbVec2f.h:36
SbPList::append
void append(void *item)
Definition: SbPList.h:78
SbMatrix
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition: SbMatrix.h:37
SoDebugError::post
static void post(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:314
SoCamera::getViewVolume
virtual SbViewVolume getViewVolume(float useaspectratio=0.0f) const =0
SbViewVolume::getMatrices
void getMatrices(SbMatrix &affine, SbMatrix &proj) const
Definition: SbViewVolume.cpp:185
SbList::truncate
void truncate(const int length, const int dofit=0)
Definition: SbList.h:149
SoOffscreenRenderer::Components
Components
Definition: SoOffscreenRenderer.h:49
SbPList
The SbPList class is a container class for void pointers.
Definition: SbPList.h:31
SoOffscreenRenderer::getBuffer
unsigned char * getBuffer(void) const
Definition: SoOffscreenRenderer.cpp:922
SbString::getSubString
SbString getSubString(int startidx, int endidx=-1) const
Definition: SbString.h:73
SoOffscreenRenderer::getViewportRegion
const SbViewportRegion & getViewportRegion(void) const
Definition: SoOffscreenRenderer.cpp:497
SoDebugError::postWarning
static void postWarning(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:324
SoFullPath
The SoFullPath class allows examination of hidden children in paths.
Definition: SoFullPath.h:29
SoOffscreenRenderer::writeToPostScript
SbBool writeToPostScript(FILE *fp) const
Definition: SoOffscreenRenderer.cpp:1038
SoOffscreenRenderer::getGLRenderAction
SoGLRenderAction * getGLRenderAction(void) const
Definition: SoOffscreenRenderer.cpp:538
SbMatrix::multRight
SbMatrix & multRight(const SbMatrix &m)
Definition: SbMatrix.cpp:1240
SbList::append
void append(const Type item)
Definition: SbList.h:98
SbString
The SbString class is a string class with convenience functions for string operations.
Definition: SbString.h:42
SoFullPath::getTail
SoNode * getTail(void) const
Definition: SoFullPath.cpp:74
SoOffscreenRenderer::setComponents
void setComponents(const Components components)
Definition: SoOffscreenRenderer.cpp:463
SoOffscreenRenderer::getScreenPixelsPerInch
static float getScreenPixelsPerInch(void)
Definition: SoOffscreenRenderer.cpp:411
SbVec2s
The SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition: SbVec2s.h:37
SoOffscreenRenderer::isWriteSupported
SbBool isWriteSupported(const SbName &filetypeextension) const
Definition: SoOffscreenRenderer.cpp:1253
SoPath
The SoPath class is a container class for traversal path descriptions.
Definition: SoPath.h:43
SbPList::truncate
void truncate(const int length, const int fit=0)
Definition: SbPList.h:100
SbList< SbName >
SbName::getString
const char * getString(void) const
Definition: SbName.cpp:278
SoDebugError::postInfo
static void postInfo(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:334
SoOffscreenRenderer::getWriteFiletypeInfo
void getWriteFiletypeInfo(const int idx, SbPList &extlist, SbString &fullname, SbString &description)
Definition: SoOffscreenRenderer.cpp:1359
SoField::get
void get(SbString &valuestring)
Definition: SoField.cpp:1291
SbColor
The SbColor class contains the red, green and blue components which make up a color value.
Definition: SbColor.h:30
SoBase
The SoBase class is the top-level superclass for a number of class-hierarchies.
Definition: SoBase.h:41
SoCamera
The SoCamera class is the abstract base class for camera definition nodes.
Definition: SoCamera.h:54
SoOffscreenRenderer::setGLRenderAction
void setGLRenderAction(SoGLRenderAction *action)
Definition: SoOffscreenRenderer.cpp:525
SoOffscreenRenderer::getMaximumResolution
static SbVec2s getMaximumResolution(void)
Definition: SoOffscreenRenderer.cpp:442
SoOffscreenRenderer::writeToRGB
SbBool writeToRGB(FILE *fp) const
Definition: SoOffscreenRenderer.cpp:996
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
SbString::sprintf
SbString & sprintf(const char *formatstr,...)
Definition: SbString.h:105
SbViewVolume::narrow
SbViewVolume narrow(float left, float bottom, float right, float top) const
Definition: SbViewVolume.cpp:386
SoOffscreenRenderer::SoOffscreenRenderer
SoOffscreenRenderer(const SbViewportRegion &viewportregion)
Definition: SoOffscreenRenderer.cpp:382
SbViewportRegion
The SbViewportRegion class is a viewport within a full window.
Definition: SbViewportRegion.h:31
SoOffscreenRenderer::setBackgroundColor
void setBackgroundColor(const SbColor &color)
Definition: SoOffscreenRenderer.cpp:507
SoGLRenderAction::getViewportRegion
const SbViewportRegion & getViewportRegion(void) const
Definition: SoGLRenderAction.cpp:688
SoOffscreenRenderer::render
SbBool render(SoNode *scene)
Definition: SoOffscreenRenderer.cpp:904
SoGLRenderAction::setRenderingIsRemote
void setRenderingIsRemote(SbBool isremote)
Definition: SoGLRenderAction.cpp:1176
SoOffscreenRenderer::getComponents
Components getComponents(void) const
Definition: SoOffscreenRenderer.cpp:474
SoOffscreenRenderer::~SoOffscreenRenderer
~SoOffscreenRenderer()
Definition: SoOffscreenRenderer.cpp:401
SbViewVolume
The SbViewVolume class is a viewing volume in 3D space.
Definition: SbViewVolume.h:41
SbTime
The SbTime class instances represents time values.
Definition: SbTime.h:41
SoOffscreenRenderer
The SoOffscreenRenderer class is used for rendering scenes in offscreen buffers.
Definition: SoOffscreenRenderer.h:47
SoBase::isOfType
SbBool isOfType(SoType type) const
Definition: SoBase.cpp:710
SoNode
The SoNode class is the base class for nodes used in scene graphs.
Definition: SoNode.h:47
SbVec3f::getValue
const float * getValue(void) const
Definition: SbVec3f.cpp:334
SoCamera::viewportMapping
SoSFEnum viewportMapping
Definition: SoCamera.h:70
SbTime::getTimeOfDay
static SbTime getTimeOfDay(void)
Definition: SbTime.cpp:139
SoOffscreenRenderer::setViewportRegion
void setViewportRegion(const SbViewportRegion &region)
Definition: SoOffscreenRenderer.cpp:488
SbString::getString
const char * getString(void) const
Definition: SbString.h:71
SbMatrix::setTranslate
void setTranslate(const SbVec3f &t)
Definition: SbMatrix.cpp:790
SoGLRenderAction::CONTINUE
@ CONTINUE
Definition: SoGLRenderAction.h:61
SoGLRenderAction::SORTED_OBJECT_BLEND
@ SORTED_OBJECT_BLEND
Definition: SoGLRenderAction.h:53
SoGLRenderAction
The SoGLRenderAction class renders the scene graph with OpenGL calls.
Definition: SoGLRenderAction.h:39
SbViewVolume::scale
void scale(float factor)
Definition: SbViewVolume.cpp:549

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

Generated on Wed Jul 24 2019 for Coin by Doxygen. 1.8.17