00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "controler-types.hh"
00026 #include "precompile-axis.hh"
00027 #include <cassert>
00028
00029 CPrecompileAxis::CPrecompileAxis(CParameterAxis * AParameterAxis) :
00030 FParameterAxis(AParameterAxis)
00031 {
00032 assert(FParameterAxis!=NULL);
00033 FParameterAxis->addPrecompileToUpdate(this);
00034 }
00035
00036 CPrecompileAxis::CPrecompileAxis(const CPrecompileAxis & APrecompile) :
00037 CPrecompile (APrecompile),
00038 FParameterAxis(static_cast<CParameterAxis*>
00039 (APrecompile.FParameterAxis->copy()))
00040 {
00041 assert(FParameterAxis!=NULL);
00042 FParameterAxis->addPrecompileToUpdate(this);
00043 }
00044
00045 CPrecompile * CPrecompileAxis::copy() const
00046 { return new CPrecompileAxis(*this); }
00047
00048 CPrecompileAxis::~CPrecompileAxis()
00049 { FParameterAxis->removePrecompileToUpdate(this); }
00050
00051 void CPrecompileAxis::setParameter(CParameter * AParameter)
00052 {
00053 switch (AParameter->getType())
00054 {
00055 case PARAMETER_AXIS:
00056 setAxis(static_cast<CParameterAxis *>(AParameter));
00057 break;
00058 }
00059 }
00060
00061 CParameter* CPrecompileAxis::getParameter() const
00062 { return FParameterAxis; }
00063
00064 void CPrecompileAxis::setAxis(CParameterAxis * AAxis)
00065 {
00066 assert(AAxis != NULL);
00067 AAxis->addPrecompileToUpdate(this);
00068 FParameterAxis->removePrecompileToUpdate(this);
00069 FParameterAxis = AAxis;
00070 setToUpdate();
00071 }
00072
00073 TPrecompile CPrecompileAxis::getType() const
00074 { return PRECOMPILE_AXIS; }
00075
00076 void CPrecompileAxis::drawModel()
00077 {
00078 const float size = FParameterAxis->getLGAxis();
00079
00080 glBegin(GL_LINES);
00081
00082 glLineWidth(FParameterAxis->getLWAxis());
00083
00084
00085 glColor3fv(FParameterAxis->getCLAxisX());
00086 glVertex3f(0,0,0); glVertex3f(size,0,0);
00087
00088 glColor3fv(FParameterAxis->getCLAxisY());
00089 glVertex3f(0,0,0); glVertex3f(0,size,0);
00090
00091 glColor3fv(FParameterAxis->getCLAxisZ());
00092 glVertex3f(0,0,0); glVertex3f(0,0,size);
00093
00094 glEnd();
00095 }
00096