Commit 26852445 authored by Will Schroeder's avatar Will Schroeder
Browse files

Initial revision

parent 27c03b5b
/*=========================================================================
Program: Visualization Toolkit
Module: vtkActorDevice.hh
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 1993-1995 Ken Martin, Will Schroeder, Bill Lorensen.
This software is copyrighted by Ken Martin, Will Schroeder and Bill Lorensen.
The following terms apply to all files associated with the software unless
explicitly disclaimed in individual files. This copyright specifically does
not apply to the related textbook "The Visualization Toolkit" ISBN
013199837-4 published by Prentice Hall which is covered by its own copyright.
The authors hereby grant permission to use, copy, and distribute this
software and its documentation for any purpose, provided that existing
copyright notices are retained in all copies and that this notice is included
verbatim in any distributions. Additionally, the authors grant permission to
modify this software and its documentation for any purpose, provided that
such modifications are not distributed without the explicit consent of the
authors and that existing copyright notices are retained in all copies. Some
of the algorithms implemented by this software are patented, observe all
applicable patent law.
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN
"AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
=========================================================================*/
// .NAME vtkActorDevice - abstract definition of a hardware dependent actor
// .SECTION Description
// vtkActorDevice is the superclass of the hardware dependent actors
// such as vtkOglrActor and vtkSbrActor. This object is typically created
// automatically by a vtkActor object when it renders. The user should
// never see this class.
// .SECTION See Also
// vtkActor vtkAssembly
#ifndef __vtkActorDevice_hh
#define __vtkActorDevice_hh
#include "vtkObject.hh"
class vtkRenderer;
class vtkActor;
class vtkActorDevice : public vtkObject
{
public:
char *GetClassName() {return "vtkActorDevice";};
// Description:
// This is the only method that the subclasses must supply.
virtual void Render(vtkActor *actor, vtkRenderer *ren) = 0;
};
#endif
/*=========================================================================
Program: Visualization Toolkit
Module: vtkOglrActor.hh
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 1993-1995 Ken Martin, Will Schroeder, Bill Lorensen.
This software is copyrighted by Ken Martin, Will Schroeder and Bill Lorensen.
The following terms apply to all files associated with the software unless
explicitly disclaimed in individual files. This copyright specifically does
not apply to the related textbook "The Visualization Toolkit" ISBN
013199837-4 published by Prentice Hall which is covered by its own copyright.
The authors hereby grant permission to use, copy, and distribute this
software and its documentation for any purpose, provided that existing
copyright notices are retained in all copies and that this notice is included
verbatim in any distributions. Additionally, the authors grant permission to
modify this software and its documentation for any purpose, provided that
such modifications are not distributed without the explicit consent of the
authors and that existing copyright notices are retained in all copies. Some
of the algorithms implemented by this software are patented, observe all
applicable patent law.
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN
"AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
=========================================================================*/
// .NAME vtkOglrActor - OpenGL actor
// .SECTION Description
// vtkOglrActor is a concrete implementation of the abstract class vtkActor.
// vtkOglrActor interfaces to the OpenGL rendering library.
#ifndef __vtkOglrActor_hh
#define __vtkOglrActor_hh
#include "vtkActorDevice.hh"
class vtkOglrRenderer;
class vtkOglrActor : public vtkActorDevice
{
protected:
public:
char *GetClassName() {return "vtkOglrActor";};
void Render(vtkActor *a, vtkRenderer *ren);
void Render(vtkActor *a, vtkOglrRenderer *ren);
};
#endif
/*=========================================================================
Program: Visualization Toolkit
Module: vtkOglrActor.cc
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 1993-1995 Ken Martin, Will Schroeder, Bill Lorensen.
This software is copyrighted by Ken Martin, Will Schroeder and Bill Lorensen.
The following terms apply to all files associated with the software unless
explicitly disclaimed in individual files. This copyright specifically does
not apply to the related textbook "The Visualization Toolkit" ISBN
013199837-4 published by Prentice Hall which is covered by its own copyright.
The authors hereby grant permission to use, copy, and distribute this
software and its documentation for any purpose, provided that existing
copyright notices are retained in all copies and that this notice is included
verbatim in any distributions. Additionally, the authors grant permission to
modify this software and its documentation for any purpose, provided that
such modifications are not distributed without the explicit consent of the
authors and that existing copyright notices are retained in all copies. Some
of the algorithms implemented by this software are patented, observe all
applicable patent law.
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN
"AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
=========================================================================*/
#include <math.h>
#ifdef _WIN32
#include <windows.h>
#endif
#include <GL/gl.h>
#include "vtkOglrRenderer.hh"
#include "vtkOglrActor.hh"
// Description:
// Implement base class method.
void vtkOglrActor::Render(vtkActor *actor, vtkRenderer *ren);
{
this->Render(actor, (vtkOglrRenderer *)ren,actor_index);
}
// Description:
// Actual actor render method.
void vtkOglrActor::Render(vtkActor *actor, vtkOglrRenderer *ren)
{
static vtkMatrix4x4 matrix;
// build transformation
actor->GetMatrix(matrix);
matrix.Transpose();
// insert model transformation
glPushMatrix();
glMultMatrixf(matrix[0]);
// render the property
if (!this->Property)
{
// force creation of a property
this->GetProperty();
}
this->Property->Render(ren);
// render the texture */
if (this->Texture) this->Texture->Render(ren);
// send a render to the mapper
if ( this->Mapper ) this->Mapper->Render(ren);
// pop transformation matrix
glPopMatrix();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment