Dr. House Developer Documentation

Similar documents
C# Programming: From Problem Analysis to Program Design. Fourth Edition

C# 2008 and.net Programming for Electronic Engineers - Elektor - ISBN

Microsoft Visual C# 2005: Developing Applications Table of Contents

3DMMVR REFERENCE MANUAL V 0.81

COPYRIGHTED MATERIAL. Contents. Part I: C# Fundamentals 1. Chapter 1: The.NET Framework 3. Chapter 2: Getting Started with Visual Studio

Tutorial: Importing static mesh (FBX)

ArcGIS Pro Extensibility - Building and Deploying Addins with the new DotNet SDK

Department of Computer Applications

Tutorial: Using the UUCS Crowd Simulation Plug-in for Unity

CS140 Final Project. Nathan Crandall, Dane Pitkin, Introduction:

Objectives. Introduce static keyword examine syntax describe common uses

Splitting the pattern into the model (this stores and manipulates the data and executes all business rules).

Introduction to Programming Microsoft.NET Applications with Visual Studio 2008 (C#)

Enterprise Architect. User Guide Series. Hybrid Scripting. Author: Sparx Systems. Date: 26/07/2018. Version: 1.0 CREATED WITH

Chapter 1: Why Program? Main Hardware Component Categories 8/23/2014. Main Hardware Component Categories: Why Program?

3D Studio Max Lesson 1.1: A Basic Overview of 3DSMax's Main Tool Bar

Chapter 4 Defining Classes I

Short Notes of CS201

User Manual. Contact the team: Contact support:

Introduction to Events

Chapter 1: Introduction to Computers and Programming

Object Explorer. Atacama Large Millimeter Array

A Java-based Computer Simulator and its Applications

Blender Notes. Introduction to Digital Modelling and Animation in Design Blender Tutorial - week 1 The Blender Interface and Basic Shapes

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1

CS201 - Introduction to Programming Glossary By

Santiago Canyon College Computer Science

Testing TargetLink. Models and C Code with Reactis

Module Road Map. 7. Version Control with Subversion Introduction Terminology

3D Body. Summary. Modified by Admin on Sep 13, Parent page: Objects

public class Foo { private int var; public int Method1() { // var accessible anywhere here } public int MethodN() {

About this document. Introduction. Where does Life Forms fit? Prev Menu Next Back p. 2

Pace University. Fundamental Concepts of CS121 1

List and Value Controls

7 Cmicro Targeting. Tutorial. Chapter

Fire Dynamics Simulator

solidthinking Inspired Tutorials 2009 solidthinking, Inc. for Mac

CS 4300 Computer Graphics

Part. Summary. Modified by Susan Riege on Aug 5, Parent page: Objects

Topic 10: Scene Management, Particle Systems and Normal Mapping. CITS4242: Game Design and Multimedia

Recap. Contents. Reenterancy of synchronized. Explicit Locks: ReentrantLock. Reenterancy of synchronise (ctd) Advanced Thread programming.

Secure Web Appliance. Basic Usage Guide

A Shared 4-D Workspace. Miranda Ko. Peter Cahoon. University of British Columbia. Vancouver, British Columbia. Canada.

XSI TO SINS: COMMANDS & SHORTCUTS

Programming. C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies

Customizing DAZ Studio

Using the TekScope IVI-COM Driver from C#.NET

NOTTORUS. Getting Started V1.00

10Tec igrid for.net 6.0 What's New in the Release

JScript Reference. Contents

ImageVis3D "Hands On"-Session

Tutorial: Making your First Level

Enrollment Operator Guide. Avigilon Access Control Manager System Version

JAVA MOCK TEST JAVA MOCK TEST III

Rules Engine Cookbook

C#: framework overview and in-the-small features

Afterwards, you will connect the scene function to the group addresses from the existing project.

Deitel Series Page How To Program Series

The Open Core Interface SDK has to be installed on your development computer. The SDK can be downloaded at:

IMPETUS-VR Documentation

Tutorial 2 - Welcome Application Introducing, the Visual Studio.NET IDE

FRAQCEL USER GUIDE

1 OBJECT-ORIENTED PROGRAMMING 1

Animation and Mechanization Tutorial

Comprehensive AngularJS Programming (5 Days)

HOW TO USE THE INSTANCING LAB IN BRYCE 7.1 PRO/ A complete tutorial

CS 270 Algorithms. Oliver Kullmann. Binary search. Lists. Background: Pointers. Trees. Implementing rooted trees. Tutorial

52 Franck van Breugel and Hamzeh Roumani

Iray for Cinema 4D Release Version 2.0 New Features Improved MDL Material Browser Stacking of MDL Material Layers

ENVI Tutorial: Introduction to ENVI

Java Primer 1: Types, Classes and Operators

Using VO Windows in a.net Windows Form Application

Nailing of a slope. c ZACE Services Ltd. August / 38 2 / 38

OpenForms360 Validation User Guide Notable Solutions Inc.

SFU CMPT 379 Compilers Spring 2018 Milestone 1. Milestone due Friday, January 26, by 11:59 pm.

STARTING COMPOSITING PROJECT

CS 380 Introduction to Computer Graphics. LAB (1) : OpenGL Tutorial Reference : Foundations of 3D Computer Graphics, Steven J.

Multiple processes can run in parallel on a single computer and multiple threads can run in parallel in a single process.

Introduction to Unreal Engine Blueprints for Beginners. By Chaven R Yenketswamy

C# Programming in the.net Framework

ARCHITECTURE & GAMES. A is for Architect Simple Mass Modeling FORM & SPACE. Industry Careers Framework. Applied. Getting Started.

Binary Space Partition Trees. Overview. Binary Space Partitioning Trees (Fuchs, Kedem and Naylor `80)

Quick Guide for the ServoWorks.NET API 2010/7/13

C# Language. CSE 409 Advanced Internet Technology

DOT.NET MODULE 6: SILVERLIGHT

RenderMonkey SDK Version 1.71

Dam removed at start of analysis. Air g = 9.8. Water SI units used. Water: Air: = 10, = Slip walls are used to model the basin.

Chapter 1: Quick Start

The Microsoft.NET Framework

Table of Contents COURSE OVERVIEW... 3 LESSON 1: OUTLOOK 2010 CALENDAR INTERFACE... 5

Maya tutorial. 1 Camera calibration

CCSI 3161 Project Flight Simulator

Tutorial: Accessing Maya tools

Microsoft Visual C# Step by Step. John Sharp

3 Getting Started with Objects

Cleaver Lab Walkthrough

Chapters and Appendix F are PDF documents posted online at the book s Companion Website (located at

Productivity! Feature Matrix

Rendering a 3-Dimensional Cube Applet Using Light Weight Java Graphing Library (LWJGL) with Java Swing with NetBeans IDE 6.1

Developing Desktop Apps for Ultrabook Devices in Windows 8*: Getting Started

Transcription:

Dr. House Developer Documentation This application is a basic graphical user interface framework for experiments on architectural meshes. The meshes are displayed in the form of wires or polygons inside the window and can be modified using custom controls in the control box at the left border of the window. By the support of OGRE3D, arbitrary information concerning the displayed meshes can be overlaid at 3D coordinates. The mesh can be translated and rotated using the mouse and keyboard. Microsoft.NET controls that provide custom test procedures can easily be added using the Visual Studio GUI. The following documentation is based on a symmetry detector that is implemented within the Dr. House framework. Contents Developer Documentation...1 Directories and Files...2 Core Part Outline...3 The Core Object...3 The Mesh Object...3 Settings and CustomControl Objects...4 The DefaultInputHandler and VertexPicking Objects...4 The Progress Class...4 The Octree Class...5 Custom Part...6 Very Important: The Rerender Flag...6 Important Hint: Use the internal access modifier for controls...6 Custom Controls...6 Control Placement, ResultsForm Window...7 Example Implementation of a Custom Application...8 Developer Documentation Basically, the program underlying Dr. House is split into two elementary parts: the core part and the customizable part. The former provides code that ideally doesn't need any adjustments, for instance OGRE initialization, navigation or mesh visualization procedures. In contrast, the customizable part is a skeleton for custom code that is controlled by custom user controls (please refer to the User Documentation) and operates on data provided by the core part as well as its own data. The following sections inform about the project directories and outline the relevant classes of the core part, followed by a customization tutorial. - 1 of 8 -

Directories and Files Subversion repository: https://svn.cg.tuwien.ac.at/data/svn/semhouse DrHouse main project directory papers pertinent publications DrHouse/doc documentation DrHouse/*.cs complete C# source code DrHouse/cpp custom C++ parts in the form of a self-contained DLL project called dll (the DLL contents are referenced by the main project's C# code) ANN: Approximate Nearest Neighbor Search FAMS: Fast Adaptive Mean Shift (efficient clustering algorithm) DrHouse/bin binaries (DLL assemblies and executables) DrHouse/skeleton configuration files and resources required during runtime DrHouse/Properties some Visual Studio generated files Files located in DrHouse/skeleton are automatically copied to the Debug or Release binary directory after the solution successfully compiled. In the project properties of the main project, the copy commands may be altered. Currently, the following commands are defined: if $(ConfigurationName) == Debug copy "$(ProjectDir)\skeleton\mogre-release\*" "$ (TargetDir)" if $(ConfigurationName) == Debug copy "$(ProjectDir)\skeleton\debug-config\*" "$ (TargetDir)" if $(ConfigurationName) == Release copy "$(ProjectDir)\skeleton\mogre-release\*" "$(TargetDir)" if $(ConfigurationName) == Release copy "$(ProjectDir)\skeleton\release-config\*" "$(TargetDir)" copy "$(ProjectDir)\skeleton\scene\*" "$(TargetDir)" copy "$(ProjectDir)\skeleton\settings\*" "$(TargetDir)" - 2 of 8 -

Core Part Outline The Core Object (class DrHouse.Core) Partial Class File Core.cs Core.Init.cs Core.OutputUpdate.cs Core.Query.cs Contents constructor, singleton instance, accessors initialization and mesh loading update of the OGRE window auxiliary settings query procedures The Core object is used as singleton. It is the program's object reference pool and furthermore provides vital initialization and data output methods. It can be regarded as the application's central object. The code of the Core object can be extended using the CustomCore class. Especially the initialization sequence may be of particular interest: It is located in the Core.init method and invoked by DrHouseForm.DrHouseForm_Load. Accessors of important objects the references of which are held by the Core object: Form The application window (link to the application window's controls). OgreWindow The panel that displays the OGRE output and receives navigation input from the mouse and keyboard. Window, Camera, Viewport, SceneManager, *Node... OGRE's actual render window and further objects owned by OGRE. ResultsForm A small control and log output window. Mesh The loaded mesh. *Vis (e.g. MeshVertexVis) mesh overlays (vertices, edges, selections). Settings Link between controls, algorithms and hard disk. The Mesh Object (class Geometry.Mesh) Provides the mesh's vertices in the form of Geometry.Vertex objects. They are queried from the internal OGRE mesh structure by the GetMeshInformation and compilevertexarrayandedgearray procedures. A Geometry.Vertex object provides the following information: index a unique identifier position x, y and z coordinates normal normal vector provided by OGRE neighbors set of the neighboring vertices - 3 of 8 -

OGRE-related information: ogremeshindex identifies the underlying OGRE mesh (generated by the compilevertexarrayandedgearray method) ogreedges list of edges that end at the vertex, provided in the form of Mesh.Edge objects that contain a reference to the OGRE edge, the end vertices of the edge and the normal vectors of the adjacent polygons. The mesh object is stored in the DrHouse.Core singleton instance and can be accessed at using the Mesh accessor. Settings and CustomControl Objects (classes DrHouse.Settings and DrHouse.CustomControl<T>) The Settings object is a central data base that stores all settings, basic settings as well as any custom settings. Since individual settings are usually manipulated by individual controls, the settings keys are named by the corresponding controls. For instance, the navigation speed setting is called speedtrackbar. Effectively, the settings object is a non-volatile control cache, the contents of which survive on the hard disk. Currently, the Settings object can store and deliver data of the types string, bool, int and float (however internally, data is always string). CustomControl is convenience wrapper for System.Windows.Forms.Controls that provides a built-in link to the Settings object as well as an event handler skeleton. The usage is described in the course of the custom part description (section Custom Part). Usage examples can be found in the partial class file DrHouseForm.Controls.cs, where CustomControl is used for the core part controls. The DefaultInputHandler and VertexPicking Objects (classes DrHouse.DefaultInputHandler and DrHouse.VertexPicking) All input handling is processed by the DefaultInputHandler object. Except for the vertex picking handlers, which are added by Core.init (because the VertexPicking object is maintained by the Core object), all input handlers are added in the DefaultInputHandler constructor. The VertexPicking object is responsible for vertex selection. To reduce processing time for large meshes, it makes use of Core.VertexOctree. The Progress Class (Interaction.Progress) The Progress class is the interface to the mainprogressbar control (located below the Open mesh... button) and can also be used for other progress bars. It can be connected to a System.ComponentModel.BackgroundWorker object, which supports threaded execution. However, in any case, the progress should be reported using the Progress.setFraction and Progress.setPercent methods (which internally call BackgroundWorker.ReportProgress). If mactivebackgroundworker is set to null, the progress bar is directly modified by the - 4 of 8 -

Progress object. If a BackgroundWorker object is used, adhere to the following recommendations: The existence of the THREADED preprocessor determines whether the BackgroundWorker's delegates are directly called or called by a separate thread. Increment the BackgroundWorking member of the Core object by 1 before a separate thread is started. After the thread finishes, decrement BackgroundWorking by 1. You can use this variable to test how many threads are currently active. Set the ActiveProgress member of the Core object to the Progress object if one exists (or otherwise set the ActiveBackgroundWorker object to the BackgroundWorker object), to indicate that the thread is cancellable. After the thread finishes, unset the ActiveProgress member by assigning null. This information is used by the cancelbutton_click event in DrHouseForm.cs. Set the Form.cancelButton.ForeColor to Color.Red before a separate thread is started and back to Color.Teal after the thread finishes. The following code snippet shows the invocation of the initialization thread (file: Core.OutputUpdate.cs): if(backgroundworking < 1) { initbackgroundworker_prepare(form.initbackgroundworker, null); #if THREADED Form.initBackgroundWorker.RunWorkerAsync(); #else initbackgroundworker_dowork(form.initbackgroundworker, null); initbackgroundworker_progresschanged(form.initbackgroundworker, new ProgressChangedEventArgs(100, null)); initbackgroundworker_runworkercompleted(form.initbackgroundworker, null); #endif } Except for initbackgroundworker_prepare, the initbackgroundworker* methods are added to the BackgroundWorker object by the init method (file: Core.Init.cs). The *_Prepare method increments BackgroundWorking, *_RunWorkerCompleted decrements it. The Octree Class (Geometry.Octree) Provides an octree for vertex picking, but can be used for arbitrary purposes and extended if necessary. - 5 of 8 -

Custom Part Use the custom part to implement your application. The skeleton of the custom part consists of the classes or files DrHouse.CustomCore (which is derived from DrHouse.Core) DrHouseForm.Controls.Custom.cs DrHouse.CustomScene Geometry.CustomMesh (which is derived from Geometry.Mesh) Arbitrary additional classes may be added to the project in order to provide custom functionality. The CustomCore class is meant for application-specific object references and initialization procedures. The initcustom method is called by the Core.init initialization sequence. Use the following methods for output update: updateallcustom(flags) This is the general update handler. Currently, flags will only be 0 (unspecific update) or CORE_EVENT_VERTEX_SELECTED (selection of a vertex happened). Usually, it simply performs a vertex/edge/... visualization update. clearselection turn selection off (afterwards, usually vertex/edge/... visualization is updated) The connection between your custom controls and the settings data base is located in the DrHouseForm.Controls.Custom.cs file, the OGRE scene can be customized in CustomScene.build (add ground plane, lights, materials) and CustomMesh allows for application-specific mesh processing. Very Important: The Rerender Flag Set the Core.RerenderRequired flag to true in order to inform the renderer that something changed. Otherwise, changes will not immediately be rendered. It will automatically be reset when the rendering is done. Important Hint: Use the internal access modifier for controls In order to directly access controls of arbitrary forms from arbitrary classes, set the control's Modifiers to Internal (instead of Private) in the Designer of Visual Studio. Custom Controls CustomControl is convenience wrapper for System.Windows.Forms.Controls that provides a built-in link to the Settings object as well as an event handler skeleton. Usage examples can be found in the partial class file DrHouseForm.Controls.cs, where CustomControl is used for the core part controls. - 6 of 8 -

Currently, the following types are supported: Type CustomControl<bool> CustomControl<int> CustomControl<float> CustomControl<string> Controls CheckBox and RadioButton NumericUpDown and TrackBar NumericUpDown ComboBox and CheckedListBox If an event handler is required, for the sake of clarity a CustomEventHandlerProc procedure should be set when the CustomControl object is initialized and preferred over the Visual Studio Designer's double-click generated event handlers. Usually, a CustomControl object is created in a one-liner, as demonstrated by the following example: new CustomControl<bool>(polygonsCheckBox, s, true).setcustomeventhandler(boolupdatevis); The boolupdatevis procedure for this control is defined as follows: CustomControl<bool>.CustomEventHandlerProc boolupdatevis = delegate(object sender, System.EventArgs e, bool defaultvalue) { mcore.updatevis(); }; The following snippet shows the corresponding condensed version: new CustomControl<bool>(polygonsCheckBox, s, true).setcustomeventhandler(delegate(object sender, System.EventArgs e, bool defaultvalue) { mcore.updatevis(); }); Special Case CheckedListBox The checked lines of a CheckedListBox control (wrapped by CustomControl<string>) are handled in the form of space-separated tokens in a string, for instance "2 5 7" if the items 2, 5 and 7 of the list 1, 2, 3, 4, 5, 6, 7, 8 are checked. Example: new CustomControl<string>(numSimSigListBox, s, "2 5 7"); Control Placement, ResultsForm Window Preferably, custom controls are placed in the area below the Visualization box. For lack of space, additional controls may be placed in the ResultsForm window (button Show Results+Nav Window), which in any case shows log outputs generated using System.Diagnostics.Debug.Print statements, provided that the DEBUG constant is defined. If the DEBUG constant is not defined, the log output tab can be used for higher level information. - 7 of 8 -

Example Implementation of a Custom Application The symmetry detection outlined in the document symmetry-detection.pdf is implemented within the source code of this Visual Studio Solution and demonstrates the customization of Dr. House. The following files are part of the example implementation and can be deleted together with the contents of custom procedures without affecting the common core application: CustomCore.CurvatureTensorEstimation.cs CustomCore.HighlightBackgroundWorker.cs Diagram.cs GeoGen.cs KdTree.cs MeanShiftTools.cs Neighborhood.cs Symmetry*.cs - 8 of 8 -