123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- /*=========================================================================
- Library: CTK
- Copyright (c) Kitware Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0.txt
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- =========================================================================*/
- #ifndef __ctkCorePythonQtDecorators_h
- #define __ctkCorePythonQtDecorators_h
- // PythonQt includes
- #include <PythonQt.h>
- // CTK includes
- #include <ctkWorkflowStep.h>
- #include <ctkWorkflowTransitions.h>
- // NOTE:
- //
- // For decorators it is assumed that the methods will never be called
- // with the self argument as NULL. The self argument is the first argument
- // for non-static methods.
- //
- /// \ingroup Core
- class ctkCorePythonQtDecorators : public QObject
- {
- Q_OBJECT
- public:
- ctkCorePythonQtDecorators()
- {
- PythonQt::self()->registerCPPClass("ctkWorkflowStep", 0, "CTKCore");
- PythonQt::self()->registerClass(&ctkWorkflowInterstepTransition::staticMetaObject, "CTKCore");
- }
- public Q_SLOTS:
- //
- // ctkWorkflowStep
- //
- ctkWorkflowStep* new_ctkWorkflowStep()
- {
- return new ctkWorkflowStep();
- }
- ctkWorkflowStep* new_ctkWorkflowStep(const QString& newId)
- {
- return new ctkWorkflowStep(newId);
- }
- void delete_ctkWorkflowStep(ctkWorkflowStep * step)
- {
- delete step;
- }
- ctkWorkflow* workflow(ctkWorkflowStep* step)const
- {
- return step->workflow();
- }
- QString id(ctkWorkflowStep* step)const
- {
- return step->id();
- }
- void setId(ctkWorkflowStep* step, const QString& newId)const
- {
- step->setId(newId);
- }
- QString name(ctkWorkflowStep* step)const
- {
- return step->name();
- }
- void setName(ctkWorkflowStep* step, const QString& newName)
- {
- step->setName(newName);
- }
- QString description(ctkWorkflowStep* step)const
- {
- return step->description();
- }
- void setDescription(ctkWorkflowStep* step, const QString& newDescription)
- {
- step->setDescription(newDescription);
- }
- QString statusText(ctkWorkflowStep* step)const
- {
- return step->statusText();
- }
- bool hasValidateCommand(ctkWorkflowStep* step)const
- {
- return step->hasValidateCommand();
- }
- void setHasValidateCommand(ctkWorkflowStep* step, bool newHasValidateCommand)
- {
- step->setHasValidateCommand(newHasValidateCommand);
- }
- bool hasOnEntryCommand(ctkWorkflowStep* step)const
- {
- return step->hasOnEntryCommand();
- }
- void setHasOnEntryCommand(ctkWorkflowStep* step, bool newHasOnEntryCommand)
- {
- step->setHasOnEntryCommand(newHasOnEntryCommand);
- }
- bool hasOnExitCommand(ctkWorkflowStep* step)const
- {
- return step->hasOnExitCommand();
- }
- void setHasOnExitCommand(ctkWorkflowStep* step, bool newHasOnExitCommand)
- {
- step->setHasOnExitCommand(newHasOnExitCommand);
- }
- QObject* ctkWorkflowStepQObject(ctkWorkflowStep* step)
- {
- return step->ctkWorkflowStepQObject();
- }
- //
- // ctkWorkflowInterstepTransition
- //
- ctkWorkflowInterstepTransition* new_ctkWorkflowInterstepTransition(ctkWorkflowInterstepTransition::InterstepTransitionType newTransitionType)
- {
- return new ctkWorkflowInterstepTransition(newTransitionType);
- }
- ctkWorkflowInterstepTransition* new_ctkWorkflowInterstepTransition(ctkWorkflowInterstepTransition::InterstepTransitionType newTransitionType, const QString& newId)
- {
- return new ctkWorkflowInterstepTransition(newTransitionType, newId);
- }
- void delete_ctkWorkflowInterstepTransition(ctkWorkflowInterstepTransition * transition)
- {
- delete transition;
- }
- };
- //-----------------------------------------------------------------------------
- void initCTKCorePythonQtDecorators()
- {
- PythonQt::self()->addDecorators(new ctkCorePythonQtDecorators);
- }
- #endif
|