KWWidgets
|
00001 /*========================================================================= 00002 00003 Module: $RCSfile: vtkKWStateMachineCluster.h,v $ 00004 00005 Copyright (c) Kitware, Inc. 00006 All rights reserved. 00007 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00008 00009 This software is distributed WITHOUT ANY WARRANTY; without even 00010 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00011 PURPOSE. See the above copyright notice for more information. 00012 00013 =========================================================================*/ 00014 // .NAME vtkKWStateMachineCluster - a state machine cluster. 00015 // .SECTION Description 00016 // This class is the basis for a state machine cluster, i.e. a means 00017 // to logically group states together. Clusters are not used by the 00018 // state machine per se, they are just a convenient way to group states 00019 // logically together, and can be used by state machine writers 00020 // (see vtkKWStateMachineDOTWriter) to display clusters as groups. 00021 // .SECTION Thanks 00022 // This work is part of the National Alliance for Medical Image 00023 // Computing (NAMIC), funded by the National Institutes of Health 00024 // through the NIH Roadmap for Medical Research, Grant U54 EB005149. 00025 // Information on the National Centers for Biomedical Computing 00026 // can be obtained from http://nihroadmap.nih.gov/bioinformatics. 00027 // .SECTION See Also 00028 // vtkKWStateMachine vtkKWStateMachineState 00029 00030 #ifndef __vtkKWStateMachineCluster_h 00031 #define __vtkKWStateMachineCluster_h 00032 00033 #include "vtkKWObject.h" 00034 00035 class vtkKWStateMachineState; 00036 class vtkKWStateMachineClusterInternals; 00037 00038 class KWWidgets_EXPORT vtkKWStateMachineCluster : public vtkKWObject 00039 { 00040 public: 00041 static vtkKWStateMachineCluster* New(); 00042 vtkTypeRevisionMacro(vtkKWStateMachineCluster, vtkKWObject); 00043 void PrintSelf(ostream& os, vtkIndent indent); 00044 00045 // Description: 00046 // Get id. 00047 vtkGetMacro(Id, vtkIdType); 00048 00049 // Description: 00050 // Set/Get simple name. 00051 vtkGetStringMacro(Name); 00052 vtkSetStringMacro(Name); 00053 00054 // Description: 00055 // Add a state. 00056 // Return 1 on success, 0 otherwise. 00057 virtual int AddState(vtkKWStateMachineState *state); 00058 virtual int HasState(vtkKWStateMachineState *state); 00059 virtual int GetNumberOfStates(); 00060 virtual vtkKWStateMachineState* GetNthState(int rank); 00061 00062 protected: 00063 vtkKWStateMachineCluster(); 00064 ~vtkKWStateMachineCluster(); 00065 00066 vtkIdType Id; 00067 char *Name; 00068 00069 // Description: 00070 // Remove state(s). 00071 virtual void RemoveState(vtkKWStateMachineState *state); 00072 virtual void RemoveAllStates(); 00073 00074 // PIMPL Encapsulation for STL containers 00075 //BTX 00076 vtkKWStateMachineClusterInternals *Internals; 00077 //ETX 00078 00079 private: 00080 00081 static vtkIdType IdCounter; 00082 00083 vtkKWStateMachineCluster(const vtkKWStateMachineCluster&); // Not implemented 00084 void operator=(const vtkKWStateMachineCluster&); // Not implemented 00085 }; 00086 00087 #endif