Text archives Help
- From: brownlee@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r2125 - in trunk: Interface Model/Lights SwigInterface UserInterface
- Date: Tue, 26 Feb 2008 12:12:11 -0700 (MST)
Author: brownlee
Date: Tue Feb 26 12:12:09 2008
New Revision: 2125
Modified:
trunk/Interface/Light.cc
trunk/Interface/Light.h
trunk/Model/Lights/PointLight.cc
trunk/SwigInterface/wxManta.py
trunk/UserInterface/XWindowUI.cc
Log:
using fromLight() funcions instead of extraneous type information
Modified: trunk/Interface/Light.cc
==============================================================================
--- trunk/Interface/Light.cc (original)
+++ trunk/Interface/Light.cc Tue Feb 26 12:12:09 2008
@@ -5,7 +5,6 @@
Light::Light()
{
- type = LIGHT_DEFAULT;
}
Light::~Light()
Modified: trunk/Interface/Light.h
==============================================================================
--- trunk/Interface/Light.h (original)
+++ trunk/Interface/Light.h Tue Feb 26 12:12:09 2008
@@ -33,11 +33,6 @@
RayPacket& sourceRays) const = 0;
void readwrite(Archive* archive);
- //! create a visible representation of the light
- enum LightType { LIGHT_DEFAULT, LIGHT_POINTLIGHT };
- int getType() { return type; }
- protected:
- int type;
private:
// Lights may not be copied.
Light( const Light & );
Modified: trunk/Model/Lights/PointLight.cc
==============================================================================
--- trunk/Model/Lights/PointLight.cc (original)
+++ trunk/Model/Lights/PointLight.cc Tue Feb 26 12:12:09 2008
@@ -18,7 +18,6 @@
PointLight::PointLight(const Vector& position, const Color& color)
: position(position), color(color)
{
- type = Light::LIGHT_POINTLIGHT;
}
PointLight::~PointLight()
Modified: trunk/SwigInterface/wxManta.py
==============================================================================
--- trunk/SwigInterface/wxManta.py (original)
+++ trunk/SwigInterface/wxManta.py Tue Feb 26 12:12:09 2008
@@ -476,12 +476,14 @@
self.originalObject = scene.getObject()
group.add(self.originalObject)
lights = scene.getLights()
- # for i in range(lights.numLights()):
-# if lights.getLight(i).getType() ==
Light.LIGHT_POINTLIGHT:
-# renderable = manta_new( PrimaryRaysOnly(manta_new(
Sphere(manta_new( CopyTextureMaterial(
((PointLight*)lights.getLight(i)).getColor())),
((PointLight*)lights.getLight(i)).getPosition(), 0.5))) )
- # if renderable != None:
- # group.add(renderable)
- # self.lightsRenderables.append(renderable)
+ for i in range(lights.numLights()):
+ #if asPoint(lights.getLight(i)):
+ light = PointLight.fromLight(lights.getLight(i))
+ if light != None:
+ renderable = manta_new( PrimaryRaysOnly(manta_new(
Sphere(manta_new( CopyTextureMaterial( light.getColor())),
light.getPosition(), 0.5))) )
+ if renderable != None:
+ group.add(renderable)
+ self.lightsRenderables.append(renderable)
scene.setObject(group)
###########################################################################
Modified: trunk/UserInterface/XWindowUI.cc
==============================================================================
--- trunk/UserInterface/XWindowUI.cc (original)
+++ trunk/UserInterface/XWindowUI.cc Tue Feb 26 12:12:09 2008
@@ -693,10 +693,11 @@
LightSet* lights = scene->getLights();
for(unsigned int i = 0; i < lights->numLights(); i++)
{
- if (lights->getLight(i)->getType() == Light::LIGHT_POINTLIGHT)
+ PointLight* light =
dynamic_cast<PointLight*>(lights->getLight(i));
+ if (light)
{
- Object* renderable = new PrimaryRaysOnly(new Sphere(new
CopyTextureMaterial(((PointLight*)lights->getLight(i))->getColor()),
((PointLight*)lights->getLight(i))->getPosition(), 0.5f));
- if (renderable != NULL)
+ Object* renderable = new PrimaryRaysOnly(new Sphere(new
CopyTextureMaterial(light->getColor()), light->getPosition(), 0.5f));
+ if (renderable)
{
group->add(renderable);
lightsRenderables.push_back(renderable);
- [Manta] r2125 - in trunk: Interface Model/Lights SwigInterface UserInterface, brownlee, 02/26/2008
Archive powered by MHonArc 2.6.16.