KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
Collapse KernelCAD ComponentsKernelCAD Components
KernelCAD Control
KernelCAD .NET Control
Methods and Properties
Menu
Model Explorer
Birds Eye View
Programming
Direct User Access
Direct Operations
Interface Queries
Printing Support
Data Types
Modes of KernelCAD Control
DIObjectGenerator class
Properties
FlatObjectArray Poperty
Context
64 bit development
Dual Mode
Initialisation Context
Overlay Editor
Memory Management
Input validation
Collapse Advanced functionalityAdvanced functionality
Collapse InterfacesInterfaces
Alphabetical list
I3DGrid
I3DBugger
I3Dpt
IAxiBase
IAxis
IBoolSection
IBoolSectionEx
IBoundary
IColor
IConstraint
IData
IDiffSurface_KC
IDIFont
IDraw
IDrawUtil
IDraw2
IElem
IElement
IKCLine
ILightSource
ILocation
ILocationEx
IMaterial
IMetrics
IMetrics2
IModel
IModel2
IModelEx
IPatch
IKCPathCollisionDetector
IProfiles
IPropertyArray
IPropertyArray2
IStdShape
IStrip
ISurface
IText
ITexture
ITransform
IUnknown
Collapse Open Cascade TechnologyOpen Cascade Technology
Collapse DataData
Collapse MovementMovement
Collapse FramesFrames
Collapse Oriented ObjectsOriented Objects
Collapse SectionsSections
Collapse GeneralGeneral
Collapse Topological InterfacesTopological Interfaces
Collapse Viewing InterfacesViewing Interfaces
Collapse Lines And CurvesLines And Curves
Collapse Symmetry InterfacesSymmetry Interfaces
Collapse Clipping plane interfacesClipping plane interfaces
Collapse AlgorithmsAlgorithms
Collapse 2D Geometry2D Geometry
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Collapse DeploymentDeployment
Collapse .NET Samples.NET Samples
Collapse C++ SamplesC++ Samples
Collapse Visual Basic SamplesVisual Basic Samples
Collapse Delphi SamplesDelphi Samples
Collapse 3D Debugger3D Debugger
Collapse DeploymentDeployment
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > KernelCAD Components > Interfaces > Viewing Interfaces > IRectangleColor_KC
IRectangleColor_KC Interface

IRectangleColor_KC Interface

SetStockStyle
SetColorCount
GetColorCount
SetColor
GetColor

IRectangleColor_KC is implemented by KernelCAD component to give access to the set of colors assigned to edge of the window of the component. The set is used to define gradient background.

The SetStockStyle method simplifies manipulation of the color scheme by using a number of predefined styles.

Sides of the window are numbered in Counter Clock Wise direction as follows: 0- bottom, 1-right, 2-top, 3-left. Corners are assumed to belong to the first end of the side, So corner 0 is the bottom left corner and corner 3 is the top left corner. Each side has a separate array of lights of size at least 1 located at arbitrary points along the side. The first color (index 0) must be located at the corner.

Location of a color on a side is specified with a float number in range [0, 1) (1 not included). Location 0 is location at the corner (the first end of the side). Location 0.5 is at the middle of the side.

By default all colors have (0.8, 1, 0.8) RGB components

Query path: KernelCAD > GetView > IView > IRectangleColor_KC

See also Background, DIView sample


HRESULT SetStockStyle(int style, Color_KC* color0, Color_KC* color1)

Parameters

style - [in] index of the style. Valid values: 0 through to 9

color0, color1 - [in] Colors used in the style.

Remarks:

This method simplifies manipulation of the color scheme by using a number of predefined styles. Valid styles are:

0 - Horizontal gradient
1 - Vertical gradient
3 - 5 - color1 at corner 0 through to 3
6 - Horizontal gradient 2/3 of color1
7 - Vertical gradient 2/3 of color1
8 - Horizontal gradient 1/3 of color1
9 - Vertical gradient 1/3 of color1

HRESULT SetColorCount(int side, int count)

Parameters

side - [in] index of the side. Valid values: 0,1,2,3

count - [in] New size of the color array on the side. Must be greater than 0.

Remarks:

The method changes size of the color array of the side. count must be greater than 0, so that all four corners have always an assigned color. New colors are created with (0.8, 1, 0.8) RGB components.


HRESULT GetColorCount(int side, int* count)

Parameters

side - [in] index of the side. Valid values: 0,1,2,3

 count - [out] The returned size of the color array on the side

Remarks:

The method returns size of the color array of the side


HRESULT SetColor(int side, int index, float location, Color_KC* color)

Parameters

side - [in] index of the side. Valid values: 0,1,2,3

 index - [in] index of the color to be modified. Must be greater or equal to 0 and less than size of the array

 location - [in] location of the color on the side. See description on the top of the page

color - [in] Components of the color

Remarks:

Modifies location and components of index-th color in the array of the side.  See description on the top of the page


HRESULT GetColor(int side, int index, float* location, Color_KC* color)

Parameters

side - [in] index of the side. Valid values: 0,1,2,3

 index - [in] index of the color to be modified. Must be greater or equal to 0 and less than size of the array

 location - [out] location of the color on the side. See description on the top of the page

color - [out] Components of the color

Remarks:

Returns location and components of index-th color in the array of the side.  See description on the top of the page