public static void ComponentInstanceSetTransform(
     ComponentInstanceRef instanceRef,
     Transformation trans)
 {
     ThrowOut(
         SUComponentInstanceSetTransform(
             instanceRef.intPtr,
             ref trans),
         "Could not set instance transform.");
 }
 public static void ComponentInstanceGetName(
     ComponentInstanceRef instanceRef,
     StringRef stringRef)
 {
     ThrowOut(
         SUComponentInstanceGetName(
             instanceRef.intPtr,
             out stringRef.intPtr),
         "Could not get component instance name.");
 }
Exemplo n.º 3
0
 public static void ComponentInstanceGetTransform(
     ComponentInstanceRef instanceRef,
     out Transformation trans)
 {
     ThrowOut(
         SUComponentInstanceGetTransform(
             instanceRef.intPtr,
             out trans),
         "Could not get instance transform.");
 }
Exemplo n.º 4
0
 public static void ComponentDefinitionCreateInstance(
     ComponentDefinitionRef compDefRef,
     ComponentInstanceRef instanceRef)
 {
     ThrowOut(
         SUComponentDefinitionCreateInstance(
             compDefRef.intPtr,
             out instanceRef.intPtr),
         "Could not create instance.");
 }
 public static void ComponentInstanceSetName(
     ComponentInstanceRef instanceRef,
     string name)
 {
     ThrowOut(
         SUComponentInstanceSetName(
             instanceRef.intPtr,
             name),
         "Could not set instance name.");
 }
 public static void ComponentInstanceGetDefinition(
     ComponentInstanceRef instanceRef,
     ComponentDefinitionRef componentDefinitionRef)
 {
     ThrowOut(
         SUComponentInstanceGetDefinition(
             instanceRef.intPtr,
             out componentDefinitionRef.intPtr),
         "Could not get component definition.");
 }
Exemplo n.º 7
0
 public static void EntitiesAddInstance(
     EntitiesRef entitiesRef,
     ComponentInstanceRef instanceRef,
     string name)
 {
     ThrowOut(
         SUEntitiesAddInstance(
             entitiesRef.intPtr,
             instanceRef.intPtr,
             name),
         "Could not add instance.");
 }
Exemplo n.º 8
0
        public static void EntitiesGetInstances(
            EntitiesRef entitiesRef,
            long len,
            ComponentInstanceRef[] instanceRefs,
            out long count)
        {
            IntPtr[] intPtrs = new IntPtr[instanceRefs.Length];

            ThrowOut(
                SUEntitiesGetInstances(
                    entitiesRef.intPtr,
                    len,
                    intPtrs,
                    out count),
                "Could not get entities instances.");

            for (int i = 0; i < instanceRefs.Length; ++i)
            {
                instanceRefs[i]        = new ComponentInstanceRef();
                instanceRefs[i].intPtr = intPtrs[i];
            }
        }
Exemplo n.º 9
0
        public static DrawingElementRef ComponentInstanceToDrawingElement(
            ComponentInstanceRef instanceRef)
        {
            IntPtr intPtr = SUComponentInstanceToDrawingElement(instanceRef.intPtr);

            if (intPtr == Invalid)
            {
                ThrowOut(
                    ErrorInvalidOutput,
                    "Could not cast instance to drawing element.");

                return(null); // Never happens, but compiler wants it.
            }
            else
            {
                DrawingElementRef drawingElementRef = new DrawingElementRef();

                drawingElementRef.intPtr = intPtr;

                return(drawingElementRef);
            }
        }