/* * Author: Andrew Mann * * Copyright (C) 2004 PlaneShift Team (info@planeshift.it, * http://www.planeshift.it) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation (version 2 of the License) * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ #ifndef GUI_PARTICLESYSTEM_HEADER #define GUI_PARTICLESYSTEM_HEADER #include "imesh/particles.h" #include "csgeom/path.h" #include "paws/pawswidget.h" #include "pawscollapsablewidget.h" class pawsEditTextBox; class pawsTextBox; class pawsButton; class pawsListBox; class pawsSpinBox; class PartSystemTracker; class PVResourceManager; class guiPSList; class guiColorRow; enum { PARTSYS_RUNNINGSTATE=0, PARTSYS_NAME, PARTSYS_PPS, PARTSYS_PARTICLE_COUNT, PARTSYS_FORCE_AMOUNT, PARTSYS_DIFFUSION, PARTSYS_EMITTER_DURATION, PARTSYS_PARTICLE_DURATION, PARTSYS_PARTICLE_DURATION_VARIANCE, PARTSYS_PARTICLE_RADIUS, PARTSYS_VISCOSITY, PARTSYS_PARTICLE_MASS, PARTSYS_PARTICLE_MASS_VARIANCE, PARTSYS_EMITTER, PARTSYS_FORCE, PARTSYS_GRAVITY, PARTSYS_COLOR }; enum { PARTSYS_PATH_NONE=0, PARTSYS_PATH_LINE, PARTSYS_PATH_CIRCLE, PARTSYS_PATH_SPIRAL, PARTSYS_PATH_MAX }; class guiParticleSystem : public pawsCollapsableWidget { public: guiParticleSystem(PawsManager* manager); virtual ~guiParticleSystem(); // implemented virtual functions from pawsWidgets virtual bool PostSetup(); virtual bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget* widget); virtual bool OnChange(pawsWidget * widget); virtual void OnListAction( pawsListBox* selected, int status ); virtual void InitializeParticleSystem(PartSystemTracker *tracker,PVResourceManager *resmgr,guiPSList *managing_list); virtual bool MatchSystem(); virtual void MatchSystemRunningState(); virtual bool MatchMaterial(); virtual bool MatchEmitter(); virtual bool MatchForce(); virtual bool MatchColor(); virtual void UpdateSystemFromInput(int system_component); virtual void UpdateEmitterFromInput(); virtual void UpdateForceFromInput(); virtual void UpdateColorFromInput(); virtual PartSystemTracker *GetParticleSystemTracker() { return pstracker; } virtual void DeleteColorRow(guiColorRow *target); virtual void ChangedColorRow(guiColorRow *target); virtual void SetupPath(); virtual void UpdatePathPosition(csTicks elapsed); protected: pawsButton *button_destroy,*button_save; pawsButton *button_runningstate; pawsEditTextBox *editbox_name; pawsSpinBox *spinbox_pps; pawsSpinBox *spinbox_particle_count; pawsSpinBox *spinbox_force_amount; pawsSpinBox *spinbox_diffusion; pawsSpinBox *spinbox_emitter_duration; pawsSpinBox *spinbox_particle_duration; pawsSpinBox *spinbox_particle_duration_variance; pawsSpinBox *spinbox_particle_radius; pawsSpinBox *spinbox_viscosity; pawsSpinBox *spinbox_particle_mass; pawsSpinBox *spinbox_particle_mass_variance; pawsButton *button_orient_arrows; pawsButton *button_path; pawsButton *button_movetocamera; pawsListBox *listbox_material; pawsListBox *listbox_emit_type; pawsListBox *listbox_force_type; pawsEditTextBox *editbox_gravity_x, *editbox_gravity_y, *editbox_gravity_z; pawsTextBox *textbox_emit_prop1, *textbox_emit_prop2, *textbox_emit_prop3, *textbox_emit_prop4; pawsSpinBox *spinbox_emit_prop1, *spinbox_emit_prop2, *spinbox_emit_prop3, *spinbox_emit_prop4; pawsSpinBox *spinbox_force_radius, *spinbox_force_range; pawsEditTextBox *editbox_force_direction_x, *editbox_force_direction_y, *editbox_force_direction_z; pawsListBox *listbox_force_range_falloff, *listbox_force_radius_falloff; pawsTextBox *textbox_force_direction, *textbox_force_direction_x, *textbox_force_direction_y, *textbox_force_direction_z; pawsTextBox *textbox_force_radius, *textbox_force_radius_falloff; pawsListBox *listbox_color_method,*listbox_color_list; pawsButton *button_color_add,*button_color_insert,*button_color_delete; pawsSpinBox *spinbox_color_prop1; pawsTextBox *textbox_color_prop1; csParticleColorMethod color_method; csParticleEmitType emitter_type; csParticleForceType force_type; PartSystemTracker *pstracker; PVResourceManager *resource_manager; guiPSList *managing_pslist; int path_type; csPath *path; csTicks path_time; csTicks path_full_cycle; csVector3 psposition; protected: // Helper function csRef GetPSObjectState(); csRef GetPSFactoryState(); }; CREATE_PAWS_FACTORY( guiParticleSystem ); #endif // #ifndef GUI_PARTICLESYSTEM_HEADER