The settings for the alignTerrain command.
@example:
# The settings giving additional control over the behaviour of alignTerrain
atSettings = AlignTerrainSettings()
atSettings.setLowerTerrain(True)
atSettings.setRaiseTerrain(True)
atSettings.setMaxRaiseDist(1000)
atSettings.setMaxLowerDist(1000)
atSettings.setBorder(True)
#Write cut/fill volumes to attributes
atSettings.setWriteCutFill(True)
# If no layers are selected, it applies to all terrain layers. Here we select a layer
heightmap = ce.getObjectsFrom(ce.scene, ce.isMapLayer, ce.withName('Heightmap'))[0]
atSettings.setTerrainLayer(heightmap)
layer = ce.getObjectsFrom(ce.scene, ce.isLayer, ce.withName("'Streetnetwork'" ))[0]
ce.alignTerrain( ce.getObjectsFrom(layer, ce.isShape ), atSettings )
此处定义的方法如下:
getBorder
getBorder(self):
Gets Border field. If enabled, a small border region around the shapes is aligned, too.
@return: Value of Border field. [True/False]
getBorderEasing
getBorderEasing(self):
Gets BorderEasing field. If enabled, terrain smoothing is applied with nonlinear easing.
@return: Value of BorderEasing field. [True/False]
getBorderGradient
getBorderGradient(self):
Gets BorderGradient field. Defines the angle of the slope in degrees that should be applied to the alignment border.
@return: Value of BorderGradient field. [float]
getBorderRange
getBorderRange(self):
Gets BorderRange field. Defines the range around the shapes in meters in which terrain smoothing is applied.
@return: Value of BorderRange field. [float]
getLowerTerrain
getLowerTerrain(self):
Gets LowerTerrain field.
@return: Value of LowerTerrain field. [True/False]
getMaxLowerDist
getMaxLowerDist(self):
Gets MaxLowerDist field. If distance between terrain and shape is smaller, terrain vertices above shape are lowered.
@return: Value of MaxLowerDist field. [float]
getMaxRaiseDist
getMaxRaiseDist(self):
Gets MaxRaiseDist field. If distance between terrain and shape is smaller, terrain vertices below shape are raised.
@return: Value of MaxRaiseDist field. [float]
getRaiseTerrain
getRaiseTerrain(self):
Gets RaiseTerrain field.
@return: Value of RaiseTerrain field. [True/False]
getSmoothBorders
getSmoothBorders(self):
Gets SmoothBorders field.
@return: Value of SmoothBorders field. ["NONE", "SMOOTH_RANGE", "CONSTANT_GRADIENT"] [str]
getTerrain
getTerrain(self):
Gets Terrain field.
@deprecated: Only for legacy scripts, use getTerrainLayer instead.
@return: Value of Terrain field. [str]
getTerrainLayer
getTerrainLayer(self):
Gets TerrainLayer field.
@return: Value of TerrainLayer field.
getWriteCutFill
getWriteCutFill(self):
Gets WriteCutFill field. If enabled, for each selected shape cut/fill volumes are approximately calculated. The values are written into the object attributes (fields "cutVolume" and "fillVolume").
@return: Value of WriteCutFill field. [True/False]
setBorder
setBorder(self, booleanValue):
Sets Border field. If enabled, a small border region around the shapes is aligned, too.
@param booleanValue: the new value. [True/False]
setBorderEasing
setBorderEasing(self, booleanValue):
Sets BorderEasing field. If enabled, terrain smoothing is applied with nonlinear easing.
@param booleanValue: the new value. [True/False]
setBorderGradient
setBorderGradient(self, floatValue):
Sets BorderGradient field. Defines the angle of the slope in degrees that should be applied to the alignment border.
@param floatValue: the new value. [float]
setBorderRange
setBorderRange(self, floatValue):
Sets BorderRange field. Defines the range around the shapes in meters in which terrain smoothing is applied.
@param floatValue: the new value. [float]
getLowerTerrain
getLowerTerrain(self):
Gets LowerTerrain field.
@return: Value of LowerTerrain field. [True/False]
setLowerTerrain
setLowerTerrain(self, booleanValue):
Sets LowerTerrain field. If enabled, terrain vertices above selected shapes are aligned.
@param booleanValue: the new value. [True/False]
setMaxLowerDist
setMaxLowerDist(self, floatValue):
Sets MaxLowerDist field. If distance between terrain and shape is smaller, terrain vertices above shape are lowered.
@param floatValue: the new value. [float]
setMaxRaiseDist
setMaxRaiseDist(self, floatValue):
Sets MaxRaiseDist field. If distance between terrain and shape is smaller, terrain vertices below shape are raised.
@param floatValue: the new value. [float]
setRaiseTerrain
setRaiseTerrain(self, booleanValue):
Sets RaiseTerrain field. If enabled, terrain vertices below selected shapes are aligned.
@param booleanValue: the new value. [True/False]
setSmoothBorders
setSmoothBorders(self, enumValue):
Sets SmoothBorders field. The smoothing method applied on the alignment border.
@param enumValue: the new value ["NONE", "SMOOTH_RANGE", "CONSTANT_GRADIENT"]. [str]
setTerrain
setTerrain(self, stringValue):
Sets Terrain field.
@deprecated: Only for legacy scripts, use setTerrainLayer instead.
@param stringValue: the new value. [str]
setTerrainLayer
setTerrainLayer(self, objectValue):
Sets TerrainLayer field.
@param objectValue: the new value.
setWriteCutFill
setWriteCutFill(self, booleanValue):
Sets WriteCutFill field. If enabled, for each selected shape cut/fill volumes are approximately calculated. The values are written into the object attributes (fields "cutVolume" and "fillVolume").
@param booleanValue: the new value. [True/False]