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
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition: SbVec2f.h:36
The SoBase class is the top-level superclass for a number of class-hierarchies.SoBase provides the ba...
Definition: SoBase.h:41
The SoOffscreenRenderer class is used for rendering scenes in offscreen buffers.If you want to render...
Definition: SoOffscreenRenderer.h:47
The SbColor class contains the red, green and blue components which make up a color value...
Definition: SbColor.h:30
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 SbPList class is a container class for void pointers.
Definition: SbPList.h:31
Components
Definition: SoOffscreenRenderer.h:49
The SoPath class is a container class for traversal path descriptions.SoPath objects contain a list o...
Definition: SoPath.h:43
The SbViewportRegion class is a viewport within a full window.The SbViewportRegion class contains inf...
Definition: SbViewportRegion.h:31
The SbString class is a string class with convenience functions for string operations.This is the class used for storing and working with character strings. It automatically takes care of supporting all the "bookkeeping" tasks usually associated with working with character strings, like memory allocation and deallocation etc.
Definition: SbString.h:42
The SbVec2s class is a 2 dimensional vector with short integer coordinates.This vector class is used ...
Definition: SbVec2s.h:37
The SbName class stores strings by reference.The class is used by Coin for storing keywords...
Definition: SbName.h:31
The SoGLRenderAction class renders the scene graph with OpenGL calls.Applying this method at a root n...
Definition: SoGLRenderAction.h:39

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

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