Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
ExtensionGenerator Class Referenceabstract

Common abstract class to generate extensions. More...

#include <ExtensionGenerator.h>

+ Inheritance diagram for ExtensionGenerator:
+ Collaboration diagram for ExtensionGenerator:

Public Member Functions

 ExtensionGenerator (const QString &camitkFilePath, const QString &outputDirectoryName)
 Initialize the extension generator using the given .camitk file Note that if the outputDir does not exist, it will be created here At the end of the constructor, the camitk file is loaded in the camitkExtensionModel attribute and outputDirectoryName is a valid directory.
 
 ExtensionGenerator (QString actionExtensionsDirectory, QString licence="", QString extensionType="NONE")
 
bool generate ()
 call all methods to generate the source code Also generate CMake files and user action classes if they don't exist and the output directory is the directory of camitkFilePath (i.e.
 
virtual void generateExtension ()
 
virtual ~ExtensionGenerator ()
 
virtual ~ExtensionGenerator ()=default
 

Protected Member Functions

void setExtensionsDirectory (QString extensionsDirectory)
 
virtual void generateExtensionCMakeLists (QString directory)
 Helpers methods.
 
virtual void generateExtensionClass (QString directory)=0
 generate an action, a component of a viewer
 
virtual void writeCFile (QString directory)=0
 
virtual void writeHFile (QString directory)=0
 
virtual void generateTestDataFiles (QString directory, QString testDataDirName)=0
 

Protected Attributes

QVector< DependencyGenerator * > dependencyGenerators
 
QString description
 
QString extensionsDirectory
 Absolute path to the extensions directory.
 
QString extensionType
 Extension type: Action or Component extension.
 
QString licence
 
QString name
 Name of the extension.
 

Detailed Description

Common abstract class to generate extensions.

Extension generator.

Note
This class is abstract and thus cannot be instantiated.

Generate extension source code from a .camitk (JSON) that contains a "camitk"/"extensions" objects.

Currently supported:

  • action extensions ("actions" JSON object inside "extensions"): generates the source code for each "action" inside the array "actions"
Note
In the template the extension $license$ is used for each generated source file to generate a license comment at the top. $license$ can either be:
  • a common license string (same as the one used in the debian /usr/share/common-licenses directory). Supported license strings: BSD, GPL (same as GPL-3) and LGPL (same as LGPL-3).
  • a specific license text written in the "license" JSON string

Constructor & Destructor Documentation

◆ ExtensionGenerator() [1/2]

ExtensionGenerator::ExtensionGenerator ( QString  actionExtensionsDirectory,
QString  licence = "",
QString  extensionType = "NONE" 
)

References extensionsDirectory, extensionType, licence, and setExtensionsDirectory().

+ Here is the call graph for this function:

◆ ~ExtensionGenerator() [1/2]

ExtensionGenerator::~ExtensionGenerator ( )
virtual

◆ ExtensionGenerator() [2/2]

ExtensionGenerator::ExtensionGenerator ( const QString &  camitkFilePath,
const QString &  outputDirectoryName 
)

Initialize the extension generator using the given .camitk file Note that if the outputDir does not exist, it will be created here At the end of the constructor, the camitk file is loaded in the camitkExtensionModel attribute and outputDirectoryName is a valid directory.

References CamiTKExtensionModel::load().

+ Here is the call graph for this function:

◆ ~ExtensionGenerator() [2/2]

virtual ExtensionGenerator::~ExtensionGenerator ( )
virtualdefault

Member Function Documentation

◆ generate()

bool ExtensionGenerator::generate ( )

call all methods to generate the source code Also generate CMake files and user action classes if they don't exist and the output directory is the directory of camitkFilePath (i.e.

if it is the first generation)

References CamiTKExtensionModel::getModel(), VariantDataModel::getValue(), TransformEngine::setTemplateString(), and TransformEngine::transformToFile().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generateExtension()

void ExtensionGenerator::generateExtension ( )
virtual

References extensionsDirectory, generateExtensionClass(), generateExtensionCMakeLists(), generateTestDataFiles(), name, testDataDirName, writeCFile(), and writeHFile().

+ Here is the call graph for this function:

◆ generateExtensionClass()

virtual void ExtensionGenerator::generateExtensionClass ( QString  directory)
protectedpure virtual

generate an action, a component of a viewer

Implemented in ActionExtensionGenerator, ComponentExtensionGenerator, LibraryGenerator, and ViewerExtensionGenerator.

Referenced by generateExtension().

+ Here is the caller graph for this function:

◆ generateExtensionCMakeLists()

void ExtensionGenerator::generateExtensionCMakeLists ( QString  directory)
protectedvirtual

Helpers methods.

Reimplemented in LibraryGenerator.

References dependencyGenerators, description, extensionType, DependencyGenerator::getCepLibsString(), DependencyGenerator::getExternalLibsString(), DependencyGenerator::getNeededActionsString(), DependencyGenerator::getNeededComponentsString(), and DependencyGenerator::getNeededViewersString().

Referenced by generateExtension().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generateTestDataFiles()

virtual void ExtensionGenerator::generateTestDataFiles ( QString  directory,
QString  testDataDirName 
)
protectedpure virtual

Implemented in ActionExtensionGenerator, ComponentExtensionGenerator, LibraryGenerator, and ViewerExtensionGenerator.

Referenced by generateExtension().

+ Here is the caller graph for this function:

◆ setExtensionsDirectory()

void ExtensionGenerator::setExtensionsDirectory ( QString  extensionsDirectory)
protected

References extensionsDirectory.

Referenced by ExtensionGenerator().

+ Here is the caller graph for this function:

◆ writeCFile()

virtual void ExtensionGenerator::writeCFile ( QString  directory)
protectedpure virtual

Implemented in ActionExtensionGenerator, ComponentExtensionGenerator, LibraryGenerator, and ViewerExtensionGenerator.

Referenced by generateExtension().

+ Here is the caller graph for this function:

◆ writeHFile()

virtual void ExtensionGenerator::writeHFile ( QString  directory)
protectedpure virtual

Implemented in ActionExtensionGenerator, ComponentExtensionGenerator, LibraryGenerator, and ViewerExtensionGenerator.

Referenced by generateExtension().

+ Here is the caller graph for this function:

Member Data Documentation

◆ dependencyGenerators

QVector<DependencyGenerator* > ExtensionGenerator::dependencyGenerators
protected

◆ description

◆ extensionsDirectory

QString ExtensionGenerator::extensionsDirectory
protected

Absolute path to the extensions directory.

Referenced by ExtensionGenerator(), generateExtension(), and setExtensionsDirectory().

◆ extensionType

QString ExtensionGenerator::extensionType
protected

Extension type: Action or Component extension.

Referenced by ExtensionGenerator(), and generateExtensionCMakeLists().

◆ licence

◆ name


The documentation for this class was generated from the following files: