Skip to content

Commit 4dc7478

Browse files
authored
Fix more wasm issues (#2548)
1 parent e53c329 commit 4dc7478

File tree

13 files changed

+309
-116
lines changed

13 files changed

+309
-116
lines changed

library/private/camera_impl.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ class camera_impl : public camera
3636
* Documented public API
3737
*/
3838
camera& setPosition(const point3_t& pos) override;
39-
point3_t getPosition() override;
40-
void getPosition(point3_t& pos) override;
39+
point3_t getPosition() const override;
40+
void getPosition(point3_t& pos) const override;
4141
camera& setFocalPoint(const point3_t& foc) override;
42-
point3_t getFocalPoint() override;
43-
void getFocalPoint(point3_t& foc) override;
42+
point3_t getFocalPoint() const override;
43+
void getFocalPoint(point3_t& foc) const override;
4444
camera& setViewUp(const vector3_t& up) override;
45-
vector3_t getViewUp() override;
46-
void getViewUp(vector3_t& up) override;
45+
vector3_t getViewUp() const override;
46+
void getViewUp(vector3_t& up) const override;
4747
camera& setViewAngle(const angle_deg_t& angle) override;
48-
angle_deg_t getViewAngle() override;
49-
void getViewAngle(angle_deg_t& angle) override;
48+
angle_deg_t getViewAngle() const override;
49+
void getViewAngle(angle_deg_t& angle) const override;
5050
camera& setState(const camera_state_t& state) override;
51-
camera_state_t getState() override;
52-
void getState(camera_state_t& state) override;
51+
camera_state_t getState() const override;
52+
void getState(camera_state_t& state) const override;
5353

5454
camera& dolly(double val) override;
5555
camera& pan(double right, double up, double forward) override;
@@ -77,7 +77,7 @@ class camera_impl : public camera
7777
* This should only be called after the renderer have been set and initialized
7878
* so that a camera is available.
7979
*/
80-
vtkCamera* GetVTKCamera();
80+
vtkCamera* GetVTKCamera() const;
8181

8282
private:
8383
class internals;

library/public/camera.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,33 +41,33 @@ class F3D_EXPORT camera
4141
/** Set the position of the camera to the provided arg */
4242
virtual camera& setPosition(const point3_t& pos) = 0;
4343
/** Return the position of the camera */
44-
[[nodiscard]] virtual point3_t getPosition() = 0;
44+
[[nodiscard]] virtual point3_t getPosition() const = 0;
4545
/** Get the position of the camera into the provided arg */
46-
virtual void getPosition(point3_t& pos) = 0;
46+
virtual void getPosition(point3_t& pos) const = 0;
4747
/** Set the focal point of the camera to the provided arg */
4848
virtual camera& setFocalPoint(const point3_t& foc) = 0;
4949
/** Return the focal point of the camera */
50-
[[nodiscard]] virtual point3_t getFocalPoint() = 0;
50+
[[nodiscard]] virtual point3_t getFocalPoint() const = 0;
5151
/** Get the focal point of the camera into the provided arg */
52-
virtual void getFocalPoint(point3_t& foc) = 0;
52+
virtual void getFocalPoint(point3_t& foc) const = 0;
5353
/** Set the view up of the camera to the provided arg */
5454
virtual camera& setViewUp(const vector3_t& up) = 0;
5555
/** Return the view up of the camera */
56-
[[nodiscard]] virtual vector3_t getViewUp() = 0;
56+
[[nodiscard]] virtual vector3_t getViewUp() const = 0;
5757
/** Get the view up of the camera into the provided arg */
58-
virtual void getViewUp(vector3_t& up) = 0;
58+
virtual void getViewUp(vector3_t& up) const = 0;
5959
/** Set the view angle in degrees of the camera to the provided arg */
6060
virtual camera& setViewAngle(const angle_deg_t& angle) = 0;
6161
/** Return the view angle in degrees of the camera */
62-
[[nodiscard]] virtual angle_deg_t getViewAngle() = 0;
62+
[[nodiscard]] virtual angle_deg_t getViewAngle() const = 0;
6363
/** Get the view angle in degrees of the camera into the provided arg */
64-
virtual void getViewAngle(angle_deg_t& angle) = 0;
64+
virtual void getViewAngle(angle_deg_t& angle) const = 0;
6565
/** Set the complete state of the provided arg */
6666
virtual camera& setState(const camera_state_t& state) = 0;
6767
/** Return the complete state of the camera */
68-
[[nodiscard]] virtual camera_state_t getState() = 0;
68+
[[nodiscard]] virtual camera_state_t getState() const = 0;
6969
/** Get the complete state of the camera into the provided arg */
70-
virtual void getState(camera_state_t& state) = 0;
70+
virtual void getState(camera_state_t& state) const = 0;
7171

7272
///@}
7373

library/src/camera_impl.cxx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ camera& camera_impl::setPosition(const point3_t& pos)
6363
}
6464

6565
//----------------------------------------------------------------------------
66-
point3_t camera_impl::getPosition()
66+
point3_t camera_impl::getPosition() const
6767
{
6868
point3_t pos;
6969
this->getPosition(pos);
7070
return pos;
7171
}
7272

7373
//----------------------------------------------------------------------------
74-
void camera_impl::getPosition(point3_t& pos)
74+
void camera_impl::getPosition(point3_t& pos) const
7575
{
7676
vtkCamera* cam = this->GetVTKCamera();
7777
cam->GetPosition(pos.data());
@@ -88,15 +88,15 @@ camera& camera_impl::setFocalPoint(const point3_t& foc)
8888
}
8989

9090
//----------------------------------------------------------------------------
91-
point3_t camera_impl::getFocalPoint()
91+
point3_t camera_impl::getFocalPoint() const
9292
{
9393
point3_t foc;
9494
this->getFocalPoint(foc);
9595
return foc;
9696
}
9797

9898
//----------------------------------------------------------------------------
99-
void camera_impl::getFocalPoint(point3_t& foc)
99+
void camera_impl::getFocalPoint(point3_t& foc) const
100100
{
101101
vtkCamera* cam = this->GetVTKCamera();
102102
cam->GetFocalPoint(foc.data());
@@ -113,15 +113,15 @@ camera& camera_impl::setViewUp(const vector3_t& up)
113113
}
114114

115115
//----------------------------------------------------------------------------
116-
vector3_t camera_impl::getViewUp()
116+
vector3_t camera_impl::getViewUp() const
117117
{
118118
vector3_t up;
119119
this->getViewUp(up);
120120
return up;
121121
}
122122

123123
//----------------------------------------------------------------------------
124-
void camera_impl::getViewUp(vector3_t& up)
124+
void camera_impl::getViewUp(vector3_t& up) const
125125
{
126126
vtkCamera* cam = this->GetVTKCamera();
127127
cam->GetViewUp(up.data());
@@ -138,15 +138,15 @@ camera& camera_impl::setViewAngle(const angle_deg_t& angle)
138138
}
139139

140140
//----------------------------------------------------------------------------
141-
angle_deg_t camera_impl::getViewAngle()
141+
angle_deg_t camera_impl::getViewAngle() const
142142
{
143143
angle_deg_t angle;
144144
this->getViewAngle(angle);
145145
return angle;
146146
}
147147

148148
//----------------------------------------------------------------------------
149-
void camera_impl::getViewAngle(angle_deg_t& angle)
149+
void camera_impl::getViewAngle(angle_deg_t& angle) const
150150
{
151151
vtkCamera* cam = this->GetVTKCamera();
152152
angle = cam->GetViewAngle();
@@ -166,15 +166,15 @@ camera& camera_impl::setState(const camera_state_t& state)
166166
}
167167

168168
//----------------------------------------------------------------------------
169-
camera_state_t camera_impl::getState()
169+
camera_state_t camera_impl::getState() const
170170
{
171171
camera_state_t state;
172172
this->getState(state);
173173
return state;
174174
}
175175

176176
//----------------------------------------------------------------------------
177-
void camera_impl::getState(camera_state_t& state)
177+
void camera_impl::getState(camera_state_t& state) const
178178
{
179179
vtkCamera* cam = this->GetVTKCamera();
180180
cam->GetPosition(state.position.data());
@@ -319,7 +319,7 @@ void camera_impl::SetVTKRenderer(vtkRenderer* renderer)
319319
}
320320

321321
//----------------------------------------------------------------------------
322-
vtkCamera* camera_impl::GetVTKCamera()
322+
vtkCamera* camera_impl::GetVTKCamera() const
323323
{
324324
return this->Internals->VTKRenderer->GetActiveCamera();
325325
}
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)