Q&A - Question

DK11 VCL Setting 3dView Properties (Base Plane, Wall Texture, Scale Z)

Question
Crag Cox asked on April 05, 2021, keyword: Developer Kernel
I would like to change the default properties of some 3D Viewer features.  In particular, I would like to set the ones below at runtime (or desgin time).  I see them in the Documentation, but am having trouble getting them to cooperate.  Any advice would be appreciated. 

TGIS_Viewer3D.ScaleZ = 500%
TGIS_Viewer3D.BasePlane = Inactive
​TGIS_Viewer3D.DemWalls = Invisble

 
 
Answers
rico52 replied March 29, 2021
Do it as below:

interface
uses
  ..., GisViewerWnd, GisTypes3D ;

type
  TfrmMain = class(TForm)
    ...
    GIS: TGIS_ViewerWnd ;
    ...
    procedure btn2D3DSwitch( Sender : TObject ) ;
    end;

procedure TfrmMain.btn2D3DSwitch( Sender : TObject ) ;
var
   bp : TGIS_Viewer3DBasePlane ;
begin
   if GIS.IsEmpty then exit ;              // do nothing if no layer is open
   GIS.View3D := not GIS.View3D ;   // change viewer 2D-3D mode
   if GIS.View3D then begin              // if viewer is in 3D mode
     GIS.Viewer3D.ScaleZ := 5.0 ;     // set ScaleZ to 500%

     bp := GIS.Viewer3D.BasePlane ; // get current BasePlane
     bp.Active := False ;                    // disable BasePlane
     GIS.Viewer3D.BasePlane := bp ; // apply settings

     GIS.Viewer3D.DemWalls := TGIS_Viewer3DDemWall.Invisible ;

     //GIS.InvalidateWholeMap ;         // apply changes, not obligatory in this case
  end;
end;
If you would like to answer the question please Sign In.
*
*
Please review our recent Privacy Policy.
If you have any questions or requests, please contact us.
Rules
The Questions and Answers (Q & A) is intended to provide a means of communication between TatukGIS customers.
 
  1. Licensed users (with active maintenance play) of TatukGIS products may contribute to the Q & A content. Read-only access is available to anyone.
  2. Keep the content positive and professional.
  3. Be courteous to others by posting information when a question or issue asked on the Q & A is answered or resolved by other means (such as with help from TatukGIS technical support). Offer others at least a hint how the posted question was answered or the issue was resolved.
  4. The Q & A is not a replacement for TatukGIS technical support. TatukGIS team may or may not regularly follow or contribute content.