home *** CD-ROM | disk | FTP | other *** search
- //**********************************************************************
- // DIVE Laboratories, Inc.
- // Copyright(c) 1995
- // All rights reserved.
- // FILE: CHANNEL.HPP
- //
- // DESCRIPTION
- // This file provides the function prototypes for the universeClass
- //
- // Author: M. Doucet
- //
- // Modification History:
- // 4/27/95 Created
- //
- //**********************************************************************
- #ifndef _CHANNEL_HPP
- #define _CHANNEL_HPP
-
- #ifdef INDIGO2
- #include <sys/types.h>
- #include <sys/time.h>
- #include <X11/Intrinsic.h>
- #include <GL/GLwMDrawA.h>
- #include <GL/gl.h>
- #include <unistd.h>
- #endif
-
- #include"position.hpp"
- #include"vector.hpp"
- #include"quat.hpp"
- #include"univ.hpp"
- #include"intxmsg.hpp"
- class channelPrivateClass;
-
- class channelClass {
-
- private:
-
- friend class amberClass;
- friend class lightPrivateClass;
- friend class universePrivateClass;
-
- channelPrivateClass *data;
-
- public:
-
- #ifndef AMBERRT
-
- // Rendering Utilities
- void initRenderSurface();
- int renderSurfaceOk();
- void createRay(D2 mousePos, Vres length, V3 from, V3 to);
- intxMsgClass *pick(D2 mousePos, flagType=TRUE);
- polygonClass* pickPolygon(D2 mousePos);
- geometryClass* pickGeometry(D2 mousePos);
-
- #endif
-
-
- // Channel Universe functions
- void setUniverse(universeClass *u);
- universeClass *getUniverse();
-
- // Rotation
- void rotate(int rotAxis, Vres rads );
- void rotate(vectorClass *axis, Vres rads);
-
- // Orientation
- void initOrientation();
- void setOrientation(quatClass q);
- void getOrientation(quatClass &q);
-
- // Direction
- void alignAxis(int axis, vectorClass *v);
- void getAxis(int axis, V3 vals);
- void getAxis(int axis, vectorClass &vec);
-
- // Position
- void translate(vectorClass delta, frameEnum frame=_LOCAL);
-
- void setPosition(positionClass *pos );
- void setPosition(V3 pos);
- void setPosition(Vres posX, Vres posY, Vres posZ );
- void getPosition(V3 pos);
- void getDirection(V3 pos);
-
- // Performance
- void viewPerformance();
- void resetPerformance();
-
- // Perspective
- void setPerspective(Vres viewingAngle=45.0);
- void resetPerspective();
-
- // Clipping and View Angle
- void setPlanes(Vres nearVal, Vres farVal);
- void setNearPlane(Vres val);
- void setFarPlane(Vres val);
- Vres getNearPlane();
- Vres getFarPlane();
- void setViewAngle(Vres angle);
- Vres getViewAngle();
-
- // Channel rendering
- void render();
-
- // User defined render fcns:
- void setPreRenderFcn( void (*fcn)(void) );
- void setPostRenderFcn( void (*fcn)(void) );
-
-
- // Render functions
- void enableState(int state);
- void disableState(int state);
- int getState();
-
- void setPolyRenderAs(polyAsEnum as);
- polyAsEnum getPolyRenderAs();
-
- void setPolyFill(polyFillEnum fill);
- polyFillEnum getPolyFill();
-
- void setPolyShading(polyShadingEnum shading);
- polyShadingEnum getPolyShading();
-
- // Fog functions
- void setFogMode(int mode);
- int getFogMode();
-
- void setFogNear(float val);
- float getFogNear();
-
- void setFogFar(float val);
- float getFogFar();
-
- void setFogDensity(float val);
- float getFogDensity();
-
- void setFogAll(F4 col, int mode, float nearVal, float farVal, float densityVal);
-
- void setFogColor(F4 col);
- void getFogColor(F4 col);
-
- void setBackgroundColor(F4 col);
- void getBackgroundColor(F4 col);
-
- // Window functions
- void *getRenderWindow();
- #ifdef INDIGO2
- void *getParentWindow();
- #endif
-
- // Constructors & Destructors
- #ifndef AMBERRT
- #ifdef WIN32
- channelClass(void *window=NULL, int useCurrentUniverse=1);
- #endif
- #ifdef INDIGO2
- channelClass(Widget window=NULL, int useCurrentUniverse=1);
- #endif
- #else
- channelClass();
- #endif
-
- ~channelClass();
- };
-
- #endif
-
-