Text archives Help
- From: abe@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r768 - in branches/itanium2: Core/Exceptions Model/Textures
- Date: Mon, 12 Dec 2005 16:11:56 -0700 (MST)
Author: abe
Date: Mon Dec 12 16:11:55 2005
New Revision: 768
Added:
branches/itanium2/Core/Exceptions/InputError.cc
branches/itanium2/Core/Exceptions/InputError.h
branches/itanium2/Core/Exceptions/OutputError.cc
branches/itanium2/Core/Exceptions/OutputError.h
branches/itanium2/Core/Exceptions/UnknownPixel.cc
branches/itanium2/Core/Exceptions/UnknownPixel.h
branches/itanium2/Model/Textures/TexCoordTexture.cc
branches/itanium2/Model/Textures/TexCoordTexture.h
Log:
Added files missing from last commit.
A Core/Exceptions/InputError.h
A Core/Exceptions/OutputError.h
A Core/Exceptions/UnknownPixel.cc
A Core/Exceptions/UnknownPixel.h
A Core/Exceptions/InputError.cc
A Core/Exceptions/OutputError.cc
A Model/Textures/TexCoordTexture.cc
A Model/Textures/TexCoordTexture.h
Added: branches/itanium2/Core/Exceptions/InputError.cc
==============================================================================
--- (empty file)
+++ branches/itanium2/Core/Exceptions/InputError.cc Mon Dec 12 16:11:55
2005
@@ -0,0 +1,58 @@
+
+/*
+ For more information, please see:
http://software.sci.utah.edu
+
+ The MIT License
+
+ Copyright (c) 2005
+ Scientific Computing and Imaging Institue, University of Utah
+
+ License for the specific language governing rights and limitations under
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+#include <Core/Exceptions/InputError.h>
+
+using namespace Manta;
+using namespace std;
+
+InputError::InputError(const std::string& msg)
+ : message_(msg)
+{
+}
+
+InputError::InputError(const InputError& copy)
+ : message_(copy.message_)
+{
+}
+
+InputError::~InputError()
+{
+}
+
+const char* InputError::message() const
+{
+ return message_.c_str();
+}
+
+const char* InputError::type() const
+{
+ return "InputError";
+}
+
Added: branches/itanium2/Core/Exceptions/InputError.h
==============================================================================
--- (empty file)
+++ branches/itanium2/Core/Exceptions/InputError.h Mon Dec 12 16:11:55
2005
@@ -0,0 +1,59 @@
+
+/*
+ For more information, please see:
http://software.sci.utah.edu
+
+ The MIT License
+
+ Copyright (c) 2005
+ Scientific Computing and Imaging Institue, University of Utah
+
+ License for the specific language governing rights and limitations under
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+// Abe Stephens, December 2005
+
+#ifndef Manta_Core_InputError_h
+#define Manta_Core_InputError_h
+
+#include <Core/Exceptions/Exception.h>
+#include <sgi_stl_warnings_off.h>
+#include <string>
+#include <sgi_stl_warnings_on.h>
+
+namespace Manta {
+ using namespace std;
+
+ // Input Errors are thrown when a problem occurs reading or parsing some
type
+ // of input, such as a texture is encountered.
+ class InputError : public SCIRun::Exception {
+ public:
+ InputError(const std::string&);
+ InputError(const InputError&);
+ virtual ~InputError();
+ virtual const char* message() const;
+ virtual const char* type() const;
+ protected:
+ private:
+ std::string message_;
+ InputError& operator=(const InputError&);
+ };
+}
+
+#endif
Added: branches/itanium2/Core/Exceptions/OutputError.cc
==============================================================================
--- (empty file)
+++ branches/itanium2/Core/Exceptions/OutputError.cc Mon Dec 12 16:11:55
2005
@@ -0,0 +1,58 @@
+
+/*
+ For more information, please see:
http://software.sci.utah.edu
+
+ The MIT License
+
+ Copyright (c) 2005
+ Scientific Computing and Imaging Institue, University of Utah
+
+ License for the specific language governing rights and limitations under
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+#include <Core/Exceptions/OutputError.h>
+
+using namespace Manta;
+using namespace std;
+
+OutputError::OutputError(const std::string& msg)
+ : message_(msg)
+{
+}
+
+OutputError::OutputError(const OutputError& copy)
+ : message_(copy.message_)
+{
+}
+
+OutputError::~OutputError()
+{
+}
+
+const char* OutputError::message() const
+{
+ return message_.c_str();
+}
+
+const char* OutputError::type() const
+{
+ return "OutputError";
+}
+
Added: branches/itanium2/Core/Exceptions/OutputError.h
==============================================================================
--- (empty file)
+++ branches/itanium2/Core/Exceptions/OutputError.h Mon Dec 12 16:11:55
2005
@@ -0,0 +1,59 @@
+
+/*
+ For more information, please see:
http://software.sci.utah.edu
+
+ The MIT License
+
+ Copyright (c) 2005
+ Scientific Computing and Imaging Institue, University of Utah
+
+ License for the specific language governing rights and limitations under
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+// Abe Stephens, December 2005
+
+#ifndef Manta_Core_OutputError_h
+#define Manta_Core_OutputError_h
+
+#include <Core/Exceptions/Exception.h>
+#include <sgi_stl_warnings_off.h>
+#include <string>
+#include <sgi_stl_warnings_on.h>
+
+namespace Manta {
+ using namespace std;
+
+ // Output errors are thrown when a non-fatal problem associated
+ // with writing out data is encountered.
+ class OutputError : public SCIRun::Exception {
+ public:
+ OutputError(const std::string&);
+ OutputError(const OutputError&);
+ virtual ~OutputError();
+ virtual const char* message() const;
+ virtual const char* type() const;
+ protected:
+ private:
+ std::string message_;
+ OutputError& operator=(const OutputError&);
+ };
+}
+
+#endif
Added: branches/itanium2/Core/Exceptions/UnknownPixel.cc
==============================================================================
--- (empty file)
+++ branches/itanium2/Core/Exceptions/UnknownPixel.cc Mon Dec 12 16:11:55
2005
@@ -0,0 +1,58 @@
+
+/*
+ For more information, please see:
http://software.sci.utah.edu
+
+ The MIT License
+
+ Copyright (c) 2005
+ Scientific Computing and Imaging Institue, University of Utah
+
+ License for the specific language governing rights and limitations under
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+#include <Core/Exceptions/UnknownPixel.h>
+
+using namespace Manta;
+using namespace std;
+
+UnknownPixel::UnknownPixel(const std::string& msg)
+ : message_(msg)
+{
+}
+
+UnknownPixel::UnknownPixel(const UnknownPixel& copy)
+ : message_(copy.message_)
+{
+}
+
+UnknownPixel::~UnknownPixel()
+{
+}
+
+const char* UnknownPixel::message() const
+{
+ return message_.c_str();
+}
+
+const char* UnknownPixel::type() const
+{
+ return "UnknownPixel";
+}
+
Added: branches/itanium2/Core/Exceptions/UnknownPixel.h
==============================================================================
--- (empty file)
+++ branches/itanium2/Core/Exceptions/UnknownPixel.h Mon Dec 12 16:11:55
2005
@@ -0,0 +1,60 @@
+
+/*
+ For more information, please see:
http://software.sci.utah.edu
+
+ The MIT License
+
+ Copyright (c) 2005
+ Scientific Computing and Imaging Institue, University of Utah
+
+ License for the specific language governing rights and limitations under
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+// Abe Stephens, December 2005
+
+#ifndef Manta_Core_UnknownPixel_h
+#define Manta_Core_UnknownPixel_h
+
+#include <Core/Exceptions/Exception.h>
+#include <sgi_stl_warnings_off.h>
+#include <string>
+#include <sgi_stl_warnings_on.h>
+
+namespace Manta {
+ using namespace std;
+
+ // Unknown pixel error is thrown if an output device is unable to handle
+ // a certain pixel type. Usually RGB and RGBA for 8bit and float colors
+ // are supported.
+ class UnknownPixel : public SCIRun::Exception {
+ public:
+ UnknownPixel(const std::string&);
+ UnknownPixel(const UnknownPixel&);
+ virtual ~UnknownPixel();
+ virtual const char* message() const;
+ virtual const char* type() const;
+ protected:
+ private:
+ std::string message_;
+ UnknownPixel& operator=(const UnknownPixel&);
+ };
+}
+
+#endif
Added: branches/itanium2/Model/Textures/TexCoordTexture.cc
==============================================================================
--- (empty file)
+++ branches/itanium2/Model/Textures/TexCoordTexture.cc Mon Dec 12 16:11:55
2005
@@ -0,0 +1,66 @@
+/*
+ For more information, please see:
http://software.sci.utah.edu
+
+ The MIT License
+
+ Copyright (c) 2005
+ Scientific Computing and Imaging Institue, University of Utah
+
+ License for the specific language governing rights and limitations under
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+#include <Model/Textures/TexCoordTexture.h>
+
+#include <Interface/RayPacket.h>
+#include <Interface/Image.h>
+
+#include <Core/Exceptions/InternalError.h>
+#include <Core/Geometry/PointVector.h>
+#include <Core/Math/MiscMath.h>
+#include <Core/Math/Trig.h>
+
+using namespace Manta;
+
+void TexCoordTexture::mapValues(RenderContext const &context,
+ RayPacket &rays,
+ Color results[] ) const
+{
+
+ // Compute the texture coordinates.
+ rays.computeTextureCoordinates3( context );
+
+ for( int i = 0; i < rays.getSize(); ++i ) {
+ RayPacket::Element &e = rays.get( i );
+
+ // Convert the coordinates to a color.
+ results[i] = Color( RGB( (ColorComponent)e.texCoords[0],
+ (ColorComponent)e.texCoords[1],
+ (ColorComponent)0 ) );
+
+
+ // results[i] = Color( RGB( (ColorComponent)1.0,
+ // (ColorComponent)1.0,
+ // (ColorComponent)0.0 ) );
+ }
+
+
+} // end mapValues
+
+
Added: branches/itanium2/Model/Textures/TexCoordTexture.h
==============================================================================
--- (empty file)
+++ branches/itanium2/Model/Textures/TexCoordTexture.h Mon Dec 12 16:11:55
2005
@@ -0,0 +1,64 @@
+/*
+ For more information, please see:
http://software.sci.utah.edu
+
+ The MIT License
+
+ Copyright (c) 2005
+ Scientific Computing and Imaging Institue, University of Utah
+
+ License for the specific language governing rights and limitations under
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+// Abe Stephens, December 2005
+
+#ifndef Manta_Model_TexCoordTexture_h
+#define Manta_Model_TexCoordTexture_h
+
+#include <MantaTypes.h>
+#include <Core/Color/ColorSpace.h>
+
+#include <Interface/Texture.h>
+
+#include <Core/Geometry/PointVector.h>
+#include <Core/Containers/Array2.h>
+#include <Core/Math/MiscMath.h>
+
+namespace Manta {
+
+ class RayPacket;
+ class RenderContext;
+ class Image;
+
+
/////////////////////////////////////////////////////////////////////////////
+ // This texture simply colors the texture based on the mapped texture
+ // coordinates of the intersected object.
+ class TexCoordTexture : public Texture< Color > {
+ public:
+ TexCoordTexture() { }
+ virtual ~TexCoordTexture() {}
+
+ virtual void mapValues( RenderContext const &context,
+ RayPacket &rays,
+ Color results[] ) const;
+ };
+
+}
+
+#endif
- [MANTA] r768 - in branches/itanium2: Core/Exceptions Model/Textures, abe, 12/12/2005
Archive powered by MHonArc 2.6.16.