C++ Samples
Demonstrates how to create a C++ application using the VideoXpert SDK
CppSamples::Drawings::AddDrawing Class Reference

This plugin sample adds a drawing to the current system. More...

#include <AddDrawing.h>

Public Member Functions

 AddDrawing (const std::string description)
 
 ~AddDrawing ()
 
CppSamples::Common::PluginRun (CppSamples::Common::DataModel *dataModel) override
 Adds a drawing to the current system. More...
 
- Public Member Functions inherited from CppSamples::Common::Plugin
 Plugin (const std::string description)
 
virtual ~Plugin ()
 
std::string GetDescription () const
 Gets the description of this plugin. More...
 
PluginGetParent () const
 Gets the reference to the parent of this plugin. More...
 
void SetParent (Plugin *parent)
 Sets the reference to the parent of this plugin. More...
 

Detailed Description

This plugin sample adds a drawing to the current system.

Definition at line 12 of file AddDrawing.h.

Inherits CppSamples::Common::Plugin.

Constructor & Destructor Documentation

CppSamples::Drawings::AddDrawing::AddDrawing ( const std::string  description)
inline

Definition at line 14 of file AddDrawing.h.

14 : CppSamples::Common::Plugin(description) { }
Plugin is the abstract class which can be a menu item and/or a sample. Every sample and menu item mus...
Definition: Plugin.h:33
CppSamples::Drawings::AddDrawing::~AddDrawing ( )
inline

Definition at line 15 of file AddDrawing.h.

15 {}

Member Function Documentation

Plugin * CppSamples::Drawings::AddDrawing::Run ( CppSamples::Common::DataModel dataModel)
overridevirtual

Adds a drawing to the current system.

Parameters
dataModelInstance of data model.

Implements CppSamples::Common::Plugin.

Definition at line 14 of file AddDrawing.cpp.

14  {
15 
16  // Read name from input
17  cout << "\n\n" << "Enter drawing name: ";
18  string name = Utility::ReadString();
19 
20  // Add Drawing
21  VxNewDrawing drawing;
22  Utilities::StrCopySafe(drawing.name, name.c_str());
23 
24  // Make the call to add the drawing into VideoXpert
25  VxResult::Value result = dataModel->VxSystem->AddDrawing(drawing);
26  if (result == VxResult::kOK)
27  cout << "\n" << "Drawing added succesfully.\n";
28  else
29  cout << "\n" << "Failed to add drawing.\n";
30 
31  // Wait for user response before going back to parent menu.
32  Utility::Pause();
33 
34  // Return reference of parent plugin to move back to parent menu.
35  return GetParent();
36 }
VxSdk::IVxSystem * VxSystem
Represents a VideoXpert system and allows the user to manage the system and devices.
Definition: Plugin.h:17
Plugin * GetParent() const
Gets the reference to the parent of this plugin.
Definition: Plugin.h:46
virtual VxResult::Value AddDrawing(VxNewDrawing &newDrawing) const =0

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