$create_object_hierarchy
HPS.Model myModel = HPS.Factory.CreateModel();
HPS.View myView = GetCanvas().GetAttachedLayout().GetAttachedView();
myView.AttachModel(myModel);
$create_subsegments
$include
myModelKey.IncludeSegment(subassemblySegment);
myModelKey.IncludeSegment(subassemblySegment);
$segment_operations
someSegment.MoveTo(newParentSegment);
someSegment.CopyTo(anotherSegment);
childSegment.Delete();
$insert_shell
int[] myFaceList = { 3, 0, 1, 2 };
shellSegment.InsertShell(myPointArray, myFaceList);
$2d_geometry
circleSegment.InsertCircle(
new HPS.Point(2, 0.5f, 0), 0.5f,
new HPS.Vector(0, 0, 1));
lineSegment.InsertLine(
new HPS.Point(3, 0.5f, 0),
new HPS.Point(4, 0.5f, 0));
lineSegment.GetVisibilityControl().SetLines(true);
$primitives
HPS.SegmentKey cylinderSegment = myModel.GetSegmentKey().Subsegment();
cylinderSegment.InsertCylinder(
new HPS.Point(5, 0, 0.5f),
new HPS.Point(5.3f, 1, 0), 0.5f);
$setting_attributes
myModel.GetSegmentKey().GetMaterialMappingControl().SetEdgeColor(
new HPS.RGBAColor(1, 0, 0));
cylinderSegment.GetVisibilityControl().SetFaces(false);
$visibility
myModel.GetSegmentKey().GetVisibilityControl().SetEdges(true);
$line_settings
shellSegment.GetMaterialMappingControl().SetFaceColor(new HPS.RGBAColor(0, 1, 0));
circleSegment.GetEdgeAttributeControl().SetWeight(3.0f);
lineSegment.GetPortfolioControl().Push(myPortfolio);
HPS.LinePatternKit myLinePatternKitpk = HPS.LinePatternKit.GetDefault(HPS.LinePattern.Default.Dashed);
myPortfolio.DefineLinePattern("dashed_pattern", myLinePatternKitpk);
lineSegment.GetLineAttributeControl().SetPattern("dashed_pattern");
$circle_segment
circleSegment.MoveTo(shellSegment);
$file_import
in_options.SetSegment(GetModel().GetSegmentKey());
GetModel().GetSegmentKey().Flush();
try
{
notifier = HPS.Stream.File.Import(path_to_file, in_options);
notifier.Wait();
}
catch (HPS.IOException e)
{
}
GetView().FitWorld();
GetView().Update();
$set_rendering_mode
if (render_mode == HPS.Rendering.Mode.HiddenLine)
GetView().SetRenderingMode(HPS.Rendering.Mode.Default);
else
GetView().SetRenderingMode(HPS.Rendering.Mode.HiddenLine);
GetView().Update();
$shadows
GetView().SetRenderingMode(HPS.Rendering.Mode.GouraudWithLines);
bool state, ignore_transparency;
uint resolution, blurring;
GetView().GetSegmentKey().GetVisualEffectsControl().ShowSimpleShadow(out state, out resolution, out blurring, out ignore_transparency);
if (state == true)
vxfkit.SetShadowMaps(false).SetSimpleShadow(false);
else
vxfkit.SetShadowMaps(
false).SetSimpleShadow(
true).SetSimpleShadowPlane(
new HPS.Plane(0, 1, 0, 0.005f));
GetView().GetSegmentKey().SetVisualEffects(vxfkit);
GetView().Update();
$loading_shell
GetView().AttachModel(model);
try
{
importOptionsKit.SetSegment(model.GetSegmentKey());
notifier = HPS.Stream.File.Import(path_to_file, importOptionsKit);
notifier.Wait();
}
catch (HPS.IOException ioe)
{
}
GetView().FitWorld();
$set_color
mySegmentKey.GetMaterialMappingControl()
.SetFaceColor(new HPS.RGBAColor(1.0f, 0.0f, 0.0f, 0.5f))
.SetEdgeColor(new HPS.RGBAColor(0, 0, 0));
mySegmentKey.GetVisibilityControl().SetEdges(true);
$set_face_texture
mySegmentKey.GetMaterialMappingControl()
.SetFaceTexture("woodDiffuse",
HPS.Material.Texture.Channel.DiffuseTexture);
$face_level_texturing
materialKitArray[0].SetDiffuseTexture("woodDiffuse");
("myPalette", materialKitArray);
model.GetSegmentKey().SetMaterialPalette("myPalette");
$set_face_colors
ulong[] faceIndices = { 0, 1, 2, 3, 4, 5 };
float[] materialIndices = { 0, 1, 2, 3, 4, 5 };
myShellKey.SetFaceIndexColorsByList(faceIndices, 0);
$search
ulong numResults = model.GetSegmentKey().Find(HPS.Search.Type.Shell,
HPS.Search.Space.SegmentOnly,
out searchResults);
while (it.IsValid())
{
if (key.Type() == HPS.Type.ShellKey)
{
}
it.Next();
}
$set_diffuse_color
materialKitArray[1].SetDiffuse(
new HPS.RGBAColor(1.0f, 0.0f, 0.0f, 0.5f));
$set_bump
model.GetSegmentKey().InsertDistantLight(new HPS.Vector(1, 1, 1));
materialKitArray[2].SetDiffuseTexture("my_texture");
materialKitArray[2].SetBump("my_heightmap");
$multitexturing
textureOptionsKit.SetModulation(true);
materialKitArray[3].SetDiffuseTexture("brickDiffuse", 0);
materialKitArray[3].SetDiffuseTexture("grassDiffuse", 1);
$mmk
myShellKit.SetMaterialMapping(myMaterialMappingKit);
$import_notifier
try
{
importOptionsKit.SetSegment(mySegmentKey);
notifier = HPS.Stream.File.Import(filename, importOptionsKit);
notifier.Wait();
}
catch (HPS.IOException ioe)
{
}
$get_model_key
HPS.SegmentKey modelSegmentKey = GetTopView().GetAttachedModel().GetSegmentKey();
$reflection
modelSegmentKey.GetVisualEffectsControl().SetSimpleReflection(true, 0.5f, 1U, false, 0, 2.0f);
modelSegmentKey.GetVisualEffectsControl().SetSimpleReflectionPlane(new HPS.Plane(0, 1, 0, 0.375f));
$set_shadows
modelSegmentKey.GetVisibilityControl().SetShadows(true);
modelSegmentKey.GetVisualEffectsControl().SetShadowMaps(true, 16, 2048, true, true);
$shadow_attributes
modelSegmentKey.GetVisualEffectsControl().SetSimpleShadow(true);
modelSegmentKey.GetVisualEffectsControl().SetSimpleShadowPlane(new HPS.Plane(0, 1, 0, 0.425f));
modelSegmentKey.GetVisualEffectsControl().SetSimpleShadowColor(new RGBAColor(0.2f, 0.2f, 0.2f));
modelSegmentKey.GetVisualEffectsControl().SetSimpleShadowLightDirection(new Vector(0, 1, 0));
$ppe
ppek.SetBloom(true, 10.0f);
myWindowKey.SetPostProcessEffects(ppek);
ppek.SetBloom(false);
$create_style
mySegmentKey.GetPortfolioControl().Push(myPortfolio);
NamedStyleDefinition myHighlightStyle = myPortfolio.DefineNamedStyle("myStyle", HPS.Database.CreateRootSegment());
myHighlightStyle.GetSource().GetMaterialMappingControl().SetFaceColor(
new HPS.RGBAColor(1.0f, 1.0f, 0.0f));
myHighlightStyle.GetSource().GetMaterialMappingControl().SetEdgeColor(
new HPS.RGBAColor(1.0f, 0.0f, 0.0f));
myHighlightStyle.GetSource().GetVisibilityControl().SetFaces(true).SetEdges(true);
mySegmentKey.GetStyleControl().PushNamed("myStyle");
$attach_operator
HPS.View myView = GetCanvas().GetAttachedLayout().GetAttachedView();
myView.GetOperatorControl().Push(myHighlightOperator);
myHighlightOperator.SetHighlightOptions(hok);
$processing_selection
while (it.IsValid())
{
if (selectionItem.ShowSelectedItem(out key))
{
if (key.Type() == HPS.Type.ShellKey)
{
}
}
it.Next();
}