Added equals operator to CUllingSet.

Update AUTHORS file.

Change tabs to 4 spaces in ive/TextureCubeMap.cpp
This commit is contained in:
Robert Osfield 2003-09-28 10:15:10 +00:00
parent 32395ae98c
commit da8ef894c1
3 changed files with 115 additions and 97 deletions

View File

@ -85,6 +85,9 @@ Mike Connell <mikec@vsect.chalmers.se>
- First implementation of shadow occlusion culling.
- improvements to 3ds plugin.
Michael Gronager <Michael.Gronager@uni-c.dk>
- jp2 plugin - for reading and writing JPEG2000 image files
Phil Atkin <philatkin@philatkin.com>
- MacOS X port.

View File

@ -55,6 +55,20 @@ class SG_EXPORT CullingSet : public Referenced
}
}
CullingSet& operator = (const CullingSet& cs)
{
if (this==&cs) return *this;
_mask = cs._mask;
_frustum = cs._frustum;
_occluderList = cs._occluderList;
_pixelSizeVector = cs._pixelSizeVector;
_smallFeatureCullingPixelSize = cs._smallFeatureCullingPixelSize;
return *this;
}
inline void set(const CullingSet& cs)
{
_mask = cs._mask;

View File

@ -1,15 +1,15 @@
/**********************************************************************
*
* FILE: TextureCubeMap.cpp
* FILE: TextureCubeMap.cpp
*
* DESCRIPTION: Read/Write osg::TextureCubeMap in binary format to disk.
* DESCRIPTION: Read/Write osg::TextureCubeMap in binary format to disk.
*
* CREATED BY: Auto generated by iveGenerated
* and later modified by Rune Schmidt Jensen.
* CREATED BY: Auto generated by iveGenerated
* and later modified by Rune Schmidt Jensen.
*
* HISTORY: Created 21.3.2003
* HISTORY: Created 21.3.2003
*
* Copyright 2003 VR-C
* Copyright 2003 VR-C
**********************************************************************/
#include "Exception.h"
@ -20,110 +20,111 @@
using namespace ive;
void TextureCubeMap::write(DataOutputStream* out){
// Write TextureCubeMap's identification.
out->writeInt(IVETEXTURECUBEMAP);
// If the osg class is inherited by any other class we should also write this to file.
osg::Texture* tex = dynamic_cast<osg::Texture*>(this);
if(tex){
((ive::Texture*)(tex))->write(out);
}
else
throw Exception("TextureCubeMap::write(): Could not cast this osg::TextureCubeMap to an osg::Texture.");
// Write TextureCubeMap's properties.
// Write TextureCubeMap's identification.
out->writeInt(IVETEXTURECUBEMAP);
// If the osg class is inherited by any other class we should also write this to file.
osg::Texture* tex = dynamic_cast<osg::Texture*>(this);
if(tex){
((ive::Texture*)(tex))->write(out);
}
else
throw Exception("TextureCubeMap::write(): Could not cast this osg::TextureCubeMap to an osg::Texture.");
// Write TextureCubeMap's properties.
// Write texture size
int width,height;
getTextureSize(width, height);
out->writeInt(width);
out->writeInt(height);
// Write texture size
int width,height;
getTextureSize(width, height);
out->writeInt(width);
out->writeInt(height);
// Write number of mipmap levels
out->writeInt(getNumMipmapLevels());
// Write number of mipmap levels
out->writeInt(getNumMipmapLevels());
// Write images if any
out->writeBool(getImage(osg::TextureCubeMap::POSITIVE_X)!=0);
if(getImage(osg::TextureCubeMap::POSITIVE_X))
((ive::Image*)(getImage(osg::TextureCubeMap::POSITIVE_X)))->write(out);
// Write images if any
out->writeBool(getImage(osg::TextureCubeMap::POSITIVE_X)!=0);
if(getImage(osg::TextureCubeMap::POSITIVE_X))
((ive::Image*)(getImage(osg::TextureCubeMap::POSITIVE_X)))->write(out);
out->writeBool(getImage(osg::TextureCubeMap::NEGATIVE_X)!=0);
if(getImage(osg::TextureCubeMap::NEGATIVE_X))
((ive::Image*)(getImage(osg::TextureCubeMap::NEGATIVE_X)))->write(out);
out->writeBool(getImage(osg::TextureCubeMap::NEGATIVE_X)!=0);
if(getImage(osg::TextureCubeMap::NEGATIVE_X))
((ive::Image*)(getImage(osg::TextureCubeMap::NEGATIVE_X)))->write(out);
out->writeBool(getImage(osg::TextureCubeMap::POSITIVE_Y)!=0);
if(getImage(osg::TextureCubeMap::POSITIVE_Y))
((ive::Image*)(getImage(osg::TextureCubeMap::POSITIVE_Y)))->write(out);
out->writeBool(getImage(osg::TextureCubeMap::POSITIVE_Y)!=0);
if(getImage(osg::TextureCubeMap::POSITIVE_Y))
((ive::Image*)(getImage(osg::TextureCubeMap::POSITIVE_Y)))->write(out);
out->writeBool(getImage(osg::TextureCubeMap::NEGATIVE_Y)!=0);
if(getImage(osg::TextureCubeMap::NEGATIVE_Y))
((ive::Image*)(getImage(osg::TextureCubeMap::NEGATIVE_Y)))->write(out);
out->writeBool(getImage(osg::TextureCubeMap::NEGATIVE_Y)!=0);
if(getImage(osg::TextureCubeMap::NEGATIVE_Y))
((ive::Image*)(getImage(osg::TextureCubeMap::NEGATIVE_Y)))->write(out);
out->writeBool(getImage(osg::TextureCubeMap::POSITIVE_Z)!=0);
if(getImage(osg::TextureCubeMap::POSITIVE_Z))
((ive::Image*)(getImage(osg::TextureCubeMap::POSITIVE_Z)))->write(out);
out->writeBool(getImage(osg::TextureCubeMap::POSITIVE_Z)!=0);
if(getImage(osg::TextureCubeMap::POSITIVE_Z))
((ive::Image*)(getImage(osg::TextureCubeMap::POSITIVE_Z)))->write(out);
out->writeBool(getImage(osg::TextureCubeMap::NEGATIVE_Z)!=0);
if(getImage(osg::TextureCubeMap::NEGATIVE_Z))
((ive::Image*)(getImage(osg::TextureCubeMap::NEGATIVE_Z)))->write(out);
out->writeBool(getImage(osg::TextureCubeMap::NEGATIVE_Z)!=0);
if(getImage(osg::TextureCubeMap::NEGATIVE_Z))
((ive::Image*)(getImage(osg::TextureCubeMap::NEGATIVE_Z)))->write(out);
}
void TextureCubeMap::read(DataInputStream* in){
// Peek on TextureCubeMap's identification.
int id = in->peekInt();
if(id == IVETEXTURECUBEMAP){
// Read TextureCubeMap's identification.
id = in->readInt();
// If the osg class is inherited by any other class we should also read this from file.
osg::Texture* tex = dynamic_cast<osg::Texture*>(this);
if(tex){
((ive::Texture*)(tex))->read(in);
}
else
throw Exception("TextureCubeMap::read(): Could not cast this osg::TextureCubeMap to an osg::Texture.");
// Read TextureCubeMap's properties
void TextureCubeMap::read(DataInputStream* in)
{
// Peek on TextureCubeMap's identification.
int id = in->peekInt();
if(id == IVETEXTURECUBEMAP){
// Read TextureCubeMap's identification.
id = in->readInt();
// If the osg class is inherited by any other class we should also read this from file.
osg::Texture* tex = dynamic_cast<osg::Texture*>(this);
if(tex){
((ive::Texture*)(tex))->read(in);
}
else
throw Exception("TextureCubeMap::read(): Could not cast this osg::TextureCubeMap to an osg::Texture.");
// Read TextureCubeMap's properties
// Read texture size
int width = in->readInt();
int height = in->readInt();
setTextureSize(width, height);
// Read texture size
int width = in->readInt();
int height = in->readInt();
setTextureSize(width, height);
// Read number of mipmap levels
setNumMipmapLevels((unsigned int)in->readInt());
// Read number of mipmap levels
setNumMipmapLevels((unsigned int)in->readInt());
// Read images if any
if(in->readBool()){
osg::Image* image = new osg::Image();
((ive::Image*)(image))->read(in);
setImage(osg::TextureCubeMap::POSITIVE_X, image);
}
if(in->readBool()){
osg::Image* image = new osg::Image();
((ive::Image*)(image))->read(in);
setImage(osg::TextureCubeMap::NEGATIVE_X, image);
}
if(in->readBool()){
osg::Image* image = new osg::Image();
((ive::Image*)(image))->read(in);
setImage(osg::TextureCubeMap::POSITIVE_Y, image);
}
if(in->readBool()){
osg::Image* image = new osg::Image();
((ive::Image*)(image))->read(in);
setImage(osg::TextureCubeMap::NEGATIVE_Y, image);
}
if(in->readBool()){
osg::Image* image = new osg::Image();
((ive::Image*)(image))->read(in);
setImage(osg::TextureCubeMap::POSITIVE_Z, image);
}
if(in->readBool()){
osg::Image* image = new osg::Image();
((ive::Image*)(image))->read(in);
setImage(osg::TextureCubeMap::NEGATIVE_Z, image);
}
// Read images if any
if(in->readBool()){
osg::Image* image = new osg::Image();
((ive::Image*)(image))->read(in);
setImage(osg::TextureCubeMap::POSITIVE_X, image);
}
if(in->readBool()){
osg::Image* image = new osg::Image();
((ive::Image*)(image))->read(in);
setImage(osg::TextureCubeMap::NEGATIVE_X, image);
}
if(in->readBool()){
osg::Image* image = new osg::Image();
((ive::Image*)(image))->read(in);
setImage(osg::TextureCubeMap::POSITIVE_Y, image);
}
if(in->readBool()){
osg::Image* image = new osg::Image();
((ive::Image*)(image))->read(in);
setImage(osg::TextureCubeMap::NEGATIVE_Y, image);
}
if(in->readBool()){
osg::Image* image = new osg::Image();
((ive::Image*)(image))->read(in);
setImage(osg::TextureCubeMap::POSITIVE_Z, image);
}
if(in->readBool()){
osg::Image* image = new osg::Image();
((ive::Image*)(image))->read(in);
setImage(osg::TextureCubeMap::NEGATIVE_Z, image);
}
}
else{
throw Exception("TextureCubeMap::read(): Expected TextureCubeMap identification.");
}
}
else{
throw Exception("TextureCubeMap::read(): Expected TextureCubeMap identification.");
}
}