PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusHapticForce.cxx
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2 Program: Plus
3 Copyright (c) John SH Baxter, Robarts Research Institute. All rights reserved.
4 See License.txt for details.
5 =========================================================================*/
6 
7 #include "PlusConfigure.h"
8 
9 #include "vtkPlusHapticForce.h"
10 #include "vtkObjectFactory.h"
11 
12 #include "vtkPlusForceFeedback.h"
13 
14 //----------------------------------------------------------------------------
15 
17 
18 //----------------------------------------------------------------------------
19 void vtkPlusHapticForce::PrintSelf(ostream& os, vtkIndent indent)
20 {
21  this->Superclass::PrintSelf(os, indent.GetNextIndent());
22  for(unsigned int i=0; i < this->forceModel.size(); i++)
23  {
24  this->forceModel[i]->PrintSelf(os, indent.GetNextIndent());
25  }
26 }
27 
28 //----------------------------------------------------------------------------
30 {
31  this->NumberOfFrames=0;
32 }
33 
34 //----------------------------------------------------------------------------
36 {
37  for(unsigned int i=0; i < this->forceModel.size(); i++)
38  {
39  forceModel[i]->UnRegister(forceModel[i]);
40  }
41 }
42 
43 //----------------------------------------------------------------------------
45 {
46  force->Register(force);
47  this->forceModel.push_back(force);
48  this->NumberOfFrames=forceModel.size();
49 }
50 
51 //----------------------------------------------------------------------------
53 {
54  if (position >= forceModel.size())
55  {
56  vtkPlusForceFeedback * copy = force;
57  this->forceModel.push_back(copy);
58  }
59  else if ( position < forceModel.size() )
60  {
61  this->forceModel.insert(forceModel.begin()+position, force);
62  }
63  this->NumberOfFrames=forceModel.size();
64 }
65 
66 //----------------------------------------------------------------------------
68 {
69  return this->forceModel[position];
70 }
71 
72 //----------------------------------------------------------------------------
74 {
75  return this->NumberOfFrames;
76 }
vtkStandardNewMacro(vtkPlusHapticForce) void vtkPlusHapticForce
void InsertForceModel(unsigned int position, vtkPlusForceFeedback *force)
for i
void AddForceModel(vtkPlusForceFeedback *force)
double * position
Definition: phidget22.h:3303
vtkPlusForceFeedback * GetForceModel(int position)
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE