ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
vtkCommandOptions Class Reference

#include <vtkCommandOptions.h>

Inheritance diagram for vtkCommandOptions:
Collaboration diagram for vtkCommandOptions:

Public Types

enum  { EVERYBODY = 0 , XMLONLY = 0x1 }
 

Public Member Functions

 vtkTypeMacro (vtkCommandOptions, vtkObject)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
int Parse (int argc, const char *const argv[])
 
void GetRemainingArguments (int *argc, char **argv[])
 
const char * GetHelp ()
 
 vtkGetMacro (HelpSelected, int)
 
 vtkSetMacro (HelpSelected, int)
 
int GetProcessType ()
 
void SetProcessType (int p)
 
 vtkGetStringMacro (UnknownArgument)
 
 vtkGetStringMacro (ErrorMessage)
 
const char * GetArgv0 ()
 
 vtkGetStringMacro (ApplicationPath)
 
int GetLastArgument ()
 
virtual int ParseExtraXMLTag (const char *, const char **)
 

Static Public Member Functions

static vtkCommandOptionsNew ()
 

Protected Types

typedef int(* CallbackType) (const char *argument, const char *value, void *call_data)
 

Protected Member Functions

 vtkCommandOptions ()
 
 ~vtkCommandOptions () override
 
void AddBooleanArgument (const char *longarg, const char *shortarg, int *var, const char *help, int type=EVERYBODY)
 
void AddDeprecatedArgument (const char *longarg, const char *shortarg, const char *help, int type=EVERYBODY)
 
void AddArgument (const char *longarg, const char *shortarg, int *var, const char *help, int type=EVERYBODY)
 
void AddArgument (const char *longarg, const char *shortarg, char **var, const char *help, int type=EVERYBODY)
 
void AddCallback (const char *longarg, const char *shortarg, CallbackType callback, void *call_data, const char *help, int type=EVERYBODY)
 
virtual void Initialize ()
 
virtual int PostProcess (int argc, const char *const *argv)
 
virtual int WrongArgument (const char *argument)
 
virtual int DeprecatedArgument (const char *argument)
 
int LoadXMLConfigFile (const char *)
 
 vtkSetStringMacro (UnknownArgument)
 
 vtkSetStringMacro (ErrorMessage)
 
 vtkSetStringMacro (XMLConfigFile)
 
void CleanArgcArgv ()
 
 vtkSetStringMacro (ApplicationPath)
 
void ComputeApplicationPath ()
 

Protected Attributes

vtkCommandOptionsXMLParserXMLParser
 

Detailed Description

Definition at line 16 of file vtkCommandOptions.h.

Member Typedef Documentation

◆ CallbackType

typedef int(* vtkCommandOptions::CallbackType) (const char *argument, const char *value, void *call_data)
protected

Prototype for callbacks.

Definition at line 95 of file vtkCommandOptions.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
EVERYBODY 
XMLONLY 

Definition at line 25 of file vtkCommandOptions.h.

Constructor & Destructor Documentation

◆ vtkCommandOptions()

vtkCommandOptions::vtkCommandOptions ( )
protected

◆ ~vtkCommandOptions()

vtkCommandOptions::~vtkCommandOptions ( )
overrideprotected

Destructor.

Definition at line 60 of file vtkCommandOptions.cxx.

References CleanArgcArgv(), and XMLParser.

Member Function Documentation

◆ AddArgument() [1/2]

void vtkCommandOptions::AddArgument ( const char *  longarg,
const char *  shortarg,
char **  var,
const char *  help,
int  type = EVERYBODY 
)
protected

◆ AddArgument() [2/2]

void vtkCommandOptions::AddArgument ( const char *  longarg,
const char *  shortarg,
int *  var,
const char *  help,
int  type = EVERYBODY 
)
protected

◆ AddBooleanArgument()

void vtkCommandOptions::AddBooleanArgument ( const char *  longarg,
const char *  shortarg,
int *  var,
const char *  help,
int  type = EVERYBODY 
)
protected

Add a command line option. For each argument added there is a long version –long and a short version -l, a help string, and a variable that is set to the value of the option. The types can be int, char*, or boolean (set to 1 of option is present). Also deprecated arguments can be added with only a help string. The help string should say that the argument is deprecated and suggest the alternative argument to use. Each option can specify in a bit flag int the processes that the option is valid for, the default is to be valid for all paraview processes.

Definition at line 213 of file vtkCommandOptions.cxx.

References vtkCommandOptionsXMLParser::AddBooleanArgument(), EVERYBODY, type, XMLONLY, and XMLParser.

Referenced by Parse().

◆ AddCallback()

void vtkCommandOptions::AddCallback ( const char *  longarg,
const char *  shortarg,
vtkCommandOptions::CallbackType  callback,
void *  call_data,
const char *  help,
int  type = EVERYBODY 
)
protected

Definition at line 274 of file vtkCommandOptions.cxx.

References callback, EVERYBODY, type, and XMLONLY.

◆ AddDeprecatedArgument()

void vtkCommandOptions::AddDeprecatedArgument ( const char *  longarg,
const char *  shortarg,
const char *  help,
int  type = EVERYBODY 
)
protected

Definition at line 184 of file vtkCommandOptions.cxx.

References EVERYBODY, type, and XMLONLY.

◆ CleanArgcArgv()

void vtkCommandOptions::CleanArgcArgv ( )
protected

Definition at line 170 of file vtkCommandOptions.cxx.

Referenced by Parse(), and ~vtkCommandOptions().

◆ ComputeApplicationPath()

void vtkCommandOptions::ComputeApplicationPath ( )
protected

Definition at line 333 of file vtkCommandOptions.cxx.

References GetArgv0().

Referenced by Parse().

◆ DeprecatedArgument()

int vtkCommandOptions::DeprecatedArgument ( const char *  argument)
protectedvirtual

This method is called when a deprecated argument is found. If it returns 0, then the parsing will fail.

Definition at line 203 of file vtkCommandOptions.cxx.

◆ GetArgv0()

const char * vtkCommandOptions::GetArgv0 ( )

Get argv[0]

Definition at line 124 of file vtkCommandOptions.cxx.

Referenced by ComputeApplicationPath().

◆ GetHelp()

const char * vtkCommandOptions::GetHelp ( )

Definition at line 80 of file vtkCommandOptions.cxx.

References width.

◆ GetLastArgument()

int vtkCommandOptions::GetLastArgument ( )

Get the index of the last argument parsed.

Definition at line 327 of file vtkCommandOptions.cxx.

◆ GetProcessType()

int vtkCommandOptions::GetProcessType ( )
inline

Set/Get the type of the process for this set of options. data-server, render-server, combined-server or client.

Definition at line 41 of file vtkCommandOptions.h.

Referenced by vtkCommandOptionsXMLParser::StartElement().

◆ GetRemainingArguments()

void vtkCommandOptions::GetRemainingArguments ( int *  argc,
char **  argv[] 
)

Definition at line 320 of file vtkCommandOptions.cxx.

◆ Initialize()

void vtkCommandOptions::Initialize ( )
protectedvirtual

Initialize arguments.

Definition at line 95 of file vtkCommandOptions.cxx.

Referenced by Parse().

◆ LoadXMLConfigFile()

int vtkCommandOptions::LoadXMLConfigFile ( const char *  fname)
protected

This method loads the paraview config file. The command line will override any of the values in this file, but all options can be in the file.

Definition at line 130 of file vtkCommandOptions.cxx.

References XMLParser.

Referenced by Parse().

◆ New()

static vtkCommandOptions* vtkCommandOptions::New ( )
static

◆ Parse()

int vtkCommandOptions::Parse ( int  argc,
const char *const  argv[] 
)

◆ ParseExtraXMLTag()

virtual int vtkCommandOptions::ParseExtraXMLTag ( const char *  ,
const char **   
)
inlinevirtual

Pass in the name and the attributes for all tags that are not Options. If it returns 1, then it is successful, and 0 if it failed.

Definition at line 79 of file vtkCommandOptions.h.

Referenced by vtkCommandOptionsXMLParser::StartElement().

◆ PostProcess()

int vtkCommandOptions::PostProcess ( int  argc,
const char *const *  argv 
)
protectedvirtual

After parsing, process extra option dependencies.

Definition at line 100 of file vtkCommandOptions.cxx.

Referenced by Parse().

◆ PrintSelf()

void vtkCommandOptions::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
override

Definition at line 355 of file vtkCommandOptions.cxx.

References QtCompat::endl().

◆ SetProcessType()

void vtkCommandOptions::SetProcessType ( int  p)
inline

Definition at line 42 of file vtkCommandOptions.h.

◆ vtkGetMacro()

vtkCommandOptions::vtkGetMacro ( HelpSelected  ,
int   
)

Was help selected?

◆ vtkGetStringMacro() [1/3]

vtkCommandOptions::vtkGetStringMacro ( ApplicationPath  )

Get full path of executable (based on Argv0)

◆ vtkGetStringMacro() [2/3]

vtkCommandOptions::vtkGetStringMacro ( ErrorMessage  )

Get the error message if Parse returned 0.

◆ vtkGetStringMacro() [3/3]

vtkCommandOptions::vtkGetStringMacro ( UnknownArgument  )

In case of unknown argument, set this variable with the unknown argument.

◆ vtkSetMacro()

vtkCommandOptions::vtkSetMacro ( HelpSelected  ,
int   
)

◆ vtkSetStringMacro() [1/4]

vtkCommandOptions::vtkSetStringMacro ( ApplicationPath  )
protected

◆ vtkSetStringMacro() [2/4]

vtkCommandOptions::vtkSetStringMacro ( ErrorMessage  )
protected

◆ vtkSetStringMacro() [3/4]

vtkCommandOptions::vtkSetStringMacro ( UnknownArgument  )
protected

◆ vtkSetStringMacro() [4/4]

vtkCommandOptions::vtkSetStringMacro ( XMLConfigFile  )
protected

◆ vtkTypeMacro()

vtkCommandOptions::vtkTypeMacro ( vtkCommandOptions  ,
vtkObject   
)

◆ WrongArgument()

int vtkCommandOptions::WrongArgument ( const char *  argument)
protectedvirtual

This method is called when wrong argument is found. If it returns 0, then the parsing will fail.

Definition at line 106 of file vtkCommandOptions.cxx.

Member Data Documentation

◆ XMLParser

vtkCommandOptionsXMLParser* vtkCommandOptions::XMLParser
protected

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