//--------------------------------------------------------------------------- #ifndef Shader1H #define Shader1H //--------------------------------------------------------------------------- #include #include #include #include #include #include #include "OlectraChart3D_TLB.h" //--------------------------------------------------------------------------- class TfrmShader : public TForm { __published: // IDE-managed Components TChart3D *Chart3D1; TChart3D *chBall; TMainMenu *MainMenu1; TMenuItem *mnuFile; TMenuItem *mnuExit; TGroupBox *gbLine1; TGroupBox *gbLine2; TGroupBox *gbLine3; TGroupBox *gbLine4; TScrollBar *scrAmbient; TScrollBar *scrIntensity; TEdit *edScale; TEdit *edLevels; TEdit *edRise; TEdit *edSweep; TCheckBox *chk3D; TCheckBox *chkCellFill; TButton *cmdExit; TButton *cmdApply; TLabel *lblSweep; TLabel *lblRise; TLabel *lblLevels; TLabel *lblAValue; TLabel *lblIValue; TLabel *lblAmbient; TLabel *lblIntensity; TLabel *lblScale; TLabel *lblDrag; TMenuItem *mnuHelp; TMenuItem *mnuAboutThisDemo; TMenuItem *N1; TMenuItem *mnuAboutOlectraChart; void __fastcall FormCreate(TObject *Sender); void __fastcall FormActivate(TObject *Sender); void __fastcall mnuExitClick(TObject *Sender); void __fastcall chBallModifyStart(TObject *Sender, VARIANT_BOOL *IsOK); void __fastcall Chart3D1ModifyStart(TObject *Sender, VARIANT_BOOL *IsOK); void __fastcall chBallMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y); void __fastcall chBallMouseMove(TObject *Sender, TShiftState Shift, int X, int Y); void __fastcall chBallMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y); void __fastcall cmdApplyClick(TObject *Sender); void __fastcall scrIntensityScroll(TObject *Sender, TScrollCode ScrollCode, int &ScrollPos); void __fastcall scrAmbientScroll(TObject *Sender, TScrollCode ScrollCode, int &ScrollPos); void __fastcall cmdExitClick(TObject *Sender); void __fastcall edLevelsKeyPress(TObject *Sender, char &Key); void __fastcall edLevelsExit(TObject *Sender); void __fastcall edRiseKeyPress(TObject *Sender, char &Key); void __fastcall edRiseExit(TObject *Sender); void __fastcall edScaleKeyPress(TObject *Sender, char &Key); void __fastcall edScaleExit(TObject *Sender); void __fastcall edSweepKeyPress(TObject *Sender, char &Key); void __fastcall edSweepExit(TObject *Sender); void __fastcall mnuAboutThisDemoClick(TObject *Sender); void __fastcall mnuAboutOlectraChartClick(TObject *Sender); private: // User declarations public: // User declarations bool FirstPass; TMouseButton ButtonDown; //Storage Values for the Ball int CenterX; int CenterY; double Radius; //Storage for tracking the mouse int LastX; int LastY; //Storage for user values double SweepVal; double RiseVal; double AmbientVal; double IntensityVal; //Functions void MakeSphereData(); void SetBallDistnLevels(int Levels); void SetChartDistnLevels(int Levels); void StartAngle(); void ApplyShaded(); void UpdateSphere(); void CalcShaded(); void CalcAngle(int X, int Y); __fastcall TfrmShader(TComponent* Owner); }; //--------------------------------------------------------------------------- extern TfrmShader *frmShader; //--------------------------------------------------------------------------- #endif