Skip to content

Commit f4b9f72

Browse files
NEDJIMAbelgacemwonder-sk
authored andcommittedDec 3, 2020
move point size to QgsPointCloud3DSymbol
1 parent d97b291 commit f4b9f72

File tree

3 files changed

+33
-97
lines changed

3 files changed

+33
-97
lines changed
 

‎python/3d/auto_generated/symbols/qgspointcloud3dsymbol.sip.in

Lines changed: 15 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,20 @@ see setLayer( :py:class:`QgsPointCloudLayer` *layer )
6262
%Docstring
6363
Sets the point cloud layer object used by the symbol
6464
see :py:func:`~QgsPointCloud3DSymbol.layer`
65+
%End
66+
67+
float pointSize() const;
68+
%Docstring
69+
Returns the point size of the point cloud
70+
71+
.. seealso:: :py:func:`setPointSize`
72+
%End
73+
74+
void setPointSize( float size );
75+
%Docstring
76+
Sets the point size
77+
78+
.. seealso:: :py:func:`pointSize`
6579
%End
6680

6781
QgsPointCloud3DSymbol::RenderingStyle renderingStyle() const;
@@ -70,6 +84,7 @@ Returns the rendering style used to render the point cloud
7084
%End
7185

7286
protected:
87+
float mPointSize = 2.0f;
7388
};
7489

7590
class QgsSingleColorPointCloud3DSymbol : QgsPointCloud3DSymbol
@@ -102,20 +117,6 @@ Constructor for QgsSingleColorPointCloud3DSymbol
102117
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
103118

104119

105-
float pointSize() const;
106-
%Docstring
107-
Returns the point size of the point cloud
108-
109-
.. seealso:: :py:func:`setPointSize`
110-
%End
111-
112-
void setPointSize( float size );
113-
%Docstring
114-
Sets the point size
115-
116-
.. seealso:: :py:func:`pointSize`
117-
%End
118-
119120
QColor singleColor() const;
120121
%Docstring
121122
Returns the color used by the renderer when using SingleColor rendering mode
@@ -162,20 +163,6 @@ Constructor for QgsColorRampPointCloud3DSymbol
162163
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
163164

164165

165-
float pointSize() const;
166-
%Docstring
167-
Returns the point size of the point cloud
168-
169-
.. seealso:: :py:func:`setPointSize`
170-
%End
171-
172-
void setPointSize( float size );
173-
%Docstring
174-
Sets the point size
175-
176-
.. seealso:: :py:func:`pointSize`
177-
%End
178-
179166
QString renderingParameter() const;
180167
%Docstring
181168
Returns the parameter used to select the color of the point cloud
@@ -256,20 +243,6 @@ Constructor for QgsRGBPointCloud3DSymbol
256243

257244
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
258245

259-
260-
float pointSize() const;
261-
%Docstring
262-
Returns the point size of the point cloud
263-
264-
.. seealso:: :py:func:`setPointSize`
265-
%End
266-
267-
void setPointSize( float size );
268-
%Docstring
269-
Sets the point size
270-
271-
.. seealso:: :py:func:`pointSize`
272-
%End
273246
};
274247

275248
/************************************************************************

‎src/3d/symbols/qgspointcloud3dsymbol.cpp

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ void QgsPointCloud3DSymbol::setLayer( QgsPointCloudLayer *layer )
3131
mLayer = layer;
3232
}
3333

34+
void QgsPointCloud3DSymbol::setPointSize( float size )
35+
{
36+
mPointSize = size;
37+
}
38+
3439
// QgsSingleColorPointCloud3DSymbol
3540

3641
QgsSingleColorPointCloud3DSymbol::QgsSingleColorPointCloud3DSymbol( QgsPointCloudLayer *layer )
@@ -70,11 +75,6 @@ void QgsSingleColorPointCloud3DSymbol::readXml( const QDomElement &elem, const Q
7075
mSingleColor.setBlueF( elem.attribute( "single-color-blue", QStringLiteral( "1.0" ) ).toFloat() );
7176
}
7277

73-
void QgsSingleColorPointCloud3DSymbol::setPointSize( float size )
74-
{
75-
mPointSize = size;
76-
}
77-
7878
void QgsSingleColorPointCloud3DSymbol::setSingleColor( QColor color )
7979
{
8080
mSingleColor = color;
@@ -136,11 +136,6 @@ void QgsColorRampPointCloud3DSymbol::setRenderingParameter( const QString &param
136136
mRenderingParameter = parameter;
137137
}
138138

139-
void QgsColorRampPointCloud3DSymbol::setPointSize( float size )
140-
{
141-
mPointSize = size;
142-
}
143-
144139
QgsColorRampShader QgsColorRampPointCloud3DSymbol::colorRampShader() const
145140
{
146141
return mColorRampShader;
@@ -187,8 +182,3 @@ void QgsRGBPointCloud3DSymbol::readXml( const QDomElement &elem, const QgsReadWr
187182
mPointSize = elem.attribute( "point-size", QStringLiteral( "2.0" ) ).toFloat();
188183
}
189184

190-
void QgsRGBPointCloud3DSymbol::setPointSize( float size )
191-
{
192-
mPointSize = size;
193-
}
194-

‎src/3d/symbols/qgspointcloud3dsymbol.h

Lines changed: 13 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,25 @@ class _3D_EXPORT QgsPointCloud3DSymbol : public QgsAbstract3DSymbol
7474
*/
7575
void setLayer( QgsPointCloudLayer *layer );
7676

77+
/**
78+
* Returns the point size of the point cloud
79+
* \see setPointSize( float size )
80+
*/
81+
float pointSize() const { return mPointSize; }
82+
83+
/**
84+
* Sets the point size
85+
* \see pointSize()
86+
*/
87+
void setPointSize( float size );
88+
7789
//! Returns the rendering style used to render the point cloud
7890
QgsPointCloud3DSymbol::RenderingStyle renderingStyle() const { return mRenderingStyle; }
7991

8092
protected:
8193
QgsPointCloud3DSymbol::RenderingStyle mRenderingStyle = QgsPointCloud3DSymbol::NoRendering;
8294
QgsPointCloudLayer *mLayer = nullptr;
95+
float mPointSize = 2.0f;
8396
};
8497

8598
/**
@@ -102,18 +115,6 @@ class _3D_EXPORT QgsSingleColorPointCloud3DSymbol : public QgsPointCloud3DSymbol
102115
void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
103116
void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
104117

105-
/**
106-
* Returns the point size of the point cloud
107-
* \see setPointSize( float size )
108-
*/
109-
float pointSize() const { return mPointSize; }
110-
111-
/**
112-
* Sets the point size
113-
* \see pointSize()
114-
*/
115-
void setPointSize( float size );
116-
117118
/**
118119
* Returns the color used by the renderer when using SingleColor rendering mode
119120
* \see setSingleColor( QColor color )
@@ -127,7 +128,6 @@ class _3D_EXPORT QgsSingleColorPointCloud3DSymbol : public QgsPointCloud3DSymbol
127128
void setSingleColor( QColor color );
128129

129130
private:
130-
float mPointSize = 2.0f;
131131
QColor mSingleColor = Qt::blue;
132132
};
133133

@@ -151,18 +151,6 @@ class _3D_EXPORT QgsColorRampPointCloud3DSymbol : public QgsPointCloud3DSymbol
151151
void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
152152
void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
153153

154-
/**
155-
* Returns the point size of the point cloud
156-
* \see setPointSize( float size )
157-
*/
158-
float pointSize() const { return mPointSize; }
159-
160-
/**
161-
* Sets the point size
162-
* \see pointSize()
163-
*/
164-
void setPointSize( float size );
165-
166154
/**
167155
* Returns the parameter used to select the color of the point cloud
168156
* \see setRenderingParameter( const QString &parameter )
@@ -206,7 +194,6 @@ class _3D_EXPORT QgsColorRampPointCloud3DSymbol : public QgsPointCloud3DSymbol
206194
void setColorRampShaderMinMax( double min, double max );
207195

208196
private:
209-
float mPointSize = 2.0f;
210197
QString mRenderingParameter;
211198
QgsColorRampShader mColorRampShader;
212199
double mColorRampShaderMin = 0.0;
@@ -232,20 +219,6 @@ class _3D_EXPORT QgsRGBPointCloud3DSymbol : public QgsPointCloud3DSymbol
232219

233220
void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
234221
void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
235-
236-
/**
237-
* Returns the point size of the point cloud
238-
* \see setPointSize( float size )
239-
*/
240-
float pointSize() const { return mPointSize; }
241-
242-
/**
243-
* Sets the point size
244-
* \see pointSize()
245-
*/
246-
void setPointSize( float size );
247-
private:
248-
float mPointSize = 2.0f;
249222
};
250223

251224
#endif // QGSPOINTCLOUD3DSYMBOL_H

0 commit comments

Comments
 (0)
Please sign in to comment.