NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cxUltrasoundSectorSource.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 
14 
15 #include "vtkObjectFactory.h"
16 #include <vtkPointData.h>
17 #include "vtkInformation.h"
18 #include "vtkInformationVector.h"
19 #include "vtkStreamingDemandDrivenPipeline.h"
20 
21 
23 
25 {
26  this->SetNumberOfInputPorts(0);
27 }
28 
30 {
31  mSector = sector;
32  this->Modified();
33 }
34 
35 void UltrasoundSectorSource::PrintSelf(ostream& os, vtkIndent indent)
36 {
37  this->Superclass::PrintSelf(os, indent);
38 }
39 
40 
41 //----------------------------------------------------------------------------
43  vtkInformation *vtkNotUsed(request),
44  vtkInformationVector **vtkNotUsed(inputVector),
45  vtkInformationVector *outputVector)
46 {
47  if (!mSector)
48  return 1;
49 
50  // get the info object
51  vtkInformation *outInfo = outputVector->GetInformationObject(0);
52 
53  // get the ouptut
54  vtkPolyData *output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
55 
56  output->SetPoints(mSector->GetPoints());
57  output->GetPointData()->SetTCoords(mSector->GetPointData()->GetTCoords());
58  output->SetStrips(mSector->GetStrips());
59 
60  return 1;
61 }
62 
63 //----------------------------------------------------------------------------
65  vtkInformation *vtkNotUsed(request),
66  vtkInformationVector **vtkNotUsed(inputVector),
67  vtkInformationVector *outputVector)
68 {
69  // get the info object
70  vtkInformation *outInfo = outputVector->GetInformationObject(0);
71 
72 // outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),
73 // -1);
74 //
75 // double* bounds = mSector->GetBounds();
76 // if (mSector)
77 // outInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_BOUNDING_BOX(),
78 // bounds[0],
79 // bounds[1],
80 // bounds[2],
81 // bounds[3],
82 // bounds[4],
83 // bounds[5]);
84 
85  return 1;
86 }
UltrasoundSectorSource::UltrasoundSectorSource
UltrasoundSectorSource()
Definition: cxUltrasoundSectorSource.cpp:24
cxUltrasoundSectorSource.h
UltrasoundSectorSource::setProbeSector
void setProbeSector(vtkPolyDataPtr sector)
Definition: cxUltrasoundSectorSource.cpp:29
vtkPolyDataPtr
vtkSmartPointer< class vtkPolyData > vtkPolyDataPtr
Definition: cxAirwaysFilterService.h:35
UltrasoundSectorSource
Source for an Ultrasound sector. The output vtkPolyData contains a polygon plus texture coordinates....
Definition: cxUltrasoundSectorSource.h:52
UltrasoundSectorSource::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Definition: cxUltrasoundSectorSource.cpp:64
UltrasoundSectorSource::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Definition: cxUltrasoundSectorSource.cpp:35
vtkStandardNewMacro
vtkStandardNewMacro(UltrasoundSectorSource)
UltrasoundSectorSource::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Definition: cxUltrasoundSectorSource.cpp:42