public void Triangle( NwVertex v1, NwVertex v2, NwVertex v3) { ++TriangleCount; }
public void Triangle(COMApi.InwSimpleVertex v1, COMApi.InwSimpleVertex v2, COMApi.InwSimpleVertex v3) { Array array_v1 = (Array)(object)v1.coord; float v1_x = (float)(array_v1.GetValue(1)); float v1_y = (float)(array_v1.GetValue(2)); float v1_z = (float)(array_v1.GetValue(3)); Array array_v2 = (Array)(object)v2.coord; float v2_x = (float)(array_v2.GetValue(1)); float v2_y = (float)(array_v2.GetValue(2)); float v2_z = (float)(array_v2.GetValue(3)); Array array_v3 = (Array)(object)v3.coord; float v3_x = (float)(array_v3.GetValue(1)); float v3_y = (float)(array_v3.GetValue(2)); float v3_z = (float)(array_v3.GetValue(3)); //Matrix float w1 = matrix[3] * v1_x + matrix[7] * v1_y + matrix[11] * v1_z + matrix[15]; var v1__x = (matrix[0] * v1_x + matrix[4] * v1_y + matrix[8] * v1_z + matrix[12]) / w1; var v1__y = (matrix[1] * v1_x + matrix[5] * v1_y + matrix[9] * v1_z + matrix[13]) / w1; var v1__z = (matrix[2] * v1_x + matrix[6] * v1_y + matrix[10] * v1_z + matrix[14]) / w1; float w2 = matrix[3] * v2_x + matrix[7] * v2_y + matrix[11] * v2_z + matrix[15]; var v2__x = (matrix[0] * v2_x + matrix[4] * v2_y + matrix[8] * v2_z + matrix[12]) / w2; var v2__y = (matrix[1] * v2_x + matrix[5] * v2_y + matrix[9] * v2_z + matrix[13]) / w2; var v2__z = (matrix[2] * v2_x + matrix[6] * v2_y + matrix[10] * v2_z + matrix[14]) / w2; float w3 = matrix[3] * v3_x + matrix[7] * v3_y + matrix[11] * v3_z + matrix[15]; var v3__x = (matrix[0] * v3_x + matrix[4] * v3_y + matrix[8] * v3_z + matrix[12]) / w3; var v3__y = (matrix[1] * v3_x + matrix[5] * v3_y + matrix[9] * v3_z + matrix[13]) / w3; var v3__z = (matrix[2] * v3_x + matrix[6] * v3_y + matrix[10] * v3_z + matrix[14]) / w3; Coords.Add((float)v1__x); Coords.Add((float)v1__y); Coords.Add((float)v1__z); Coords.Add((float)v2__x); Coords.Add((float)v2__y); Coords.Add((float)v2__z); Coords.Add((float)v3__x); Coords.Add((float)v3__y); Coords.Add((float)v3__z); }
} // Unused public void Triangle(ComApi.InwSimpleVertex v1, ComApi.InwSimpleVertex v2, ComApi.InwSimpleVertex v3) { // Clear String KANGVars.PrimitiveOutputString = ""; // Get Primitive Data And Evaluate For Min/Max #region Vertex 1 // Array array_v1 = (Array)(object)v1.coord; // X float fVal_nw2013_VS2010 = (float)(array_v1.GetValue(1)); // Cast .coord 1 Value As float KANGVars.PrimitiveOutputString = KANGVars.PrimitiveOutputString + KANGVars.strg + "," + "Vertex 1 " + ","; KANGVars.PrimitiveOutputString = KANGVars.PrimitiveOutputString + fVal_nw2013_VS2010.ToString() + ","; // x if (fVal_nw2013_VS2010 > KANGlobalMinMaxCoords.maxX) // Check If New Maximum { KANGlobalMinMaxCoords.maxX = fVal_nw2013_VS2010; } if (fVal_nw2013_VS2010 < KANGlobalMinMaxCoords.minX) // Check If New Minimum { KANGlobalMinMaxCoords.minX = fVal_nw2013_VS2010; } // Y fVal_nw2013_VS2010 = (float)(array_v1.GetValue(2)); // Cast .coord 2 Value As float KANGVars.PrimitiveOutputString = KANGVars.PrimitiveOutputString + fVal_nw2013_VS2010.ToString() + ","; // y if (fVal_nw2013_VS2010 > KANGlobalMinMaxCoords.maxY) // Check If New Maximum { KANGlobalMinMaxCoords.maxY = fVal_nw2013_VS2010; } if (fVal_nw2013_VS2010 < KANGlobalMinMaxCoords.minY) // Check If New Minimum { KANGlobalMinMaxCoords.minY = fVal_nw2013_VS2010; } //Z fVal_nw2013_VS2010 = (float)(array_v1.GetValue(3)); // Cast .coord 3 Value As float KANGVars.PrimitiveOutputString = KANGVars.PrimitiveOutputString + fVal_nw2013_VS2010.ToString() + "\n"; // z if (fVal_nw2013_VS2010 > KANGlobalMinMaxCoords.maxZ) // Check If New Maximum { KANGlobalMinMaxCoords.maxZ = fVal_nw2013_VS2010; } if (fVal_nw2013_VS2010 < KANGlobalMinMaxCoords.minZ) // Check If New Minimum { KANGlobalMinMaxCoords.minZ = fVal_nw2013_VS2010; } #endregion // Vertex 1 // #region Vertex 2 // Array array_v2 = (Array)(object)v2.coord; // X fVal_nw2013_VS2010 = (float)(array_v2.GetValue(1)); // Cast .coord 1 Value As float KANGVars.PrimitiveOutputString = KANGVars.PrimitiveOutputString + KANGVars.strg + "," + "Vertex 2 " + ","; KANGVars.PrimitiveOutputString = KANGVars.PrimitiveOutputString + fVal_nw2013_VS2010.ToString() + ","; // x if (fVal_nw2013_VS2010 > KANGlobalMinMaxCoords.maxX) // Check If New Maximum { KANGlobalMinMaxCoords.maxX = fVal_nw2013_VS2010; } if (fVal_nw2013_VS2010 < KANGlobalMinMaxCoords.minX) // Check If New Minimum { KANGlobalMinMaxCoords.minX = fVal_nw2013_VS2010; } // Y fVal_nw2013_VS2010 = (float)(array_v2.GetValue(2)); // Cast .coord 2 Value As float KANGVars.PrimitiveOutputString = KANGVars.PrimitiveOutputString + fVal_nw2013_VS2010.ToString() + ","; // y if (fVal_nw2013_VS2010 > KANGlobalMinMaxCoords.maxY) // Check If New Maximum { KANGlobalMinMaxCoords.maxY = fVal_nw2013_VS2010; } if (fVal_nw2013_VS2010 < KANGlobalMinMaxCoords.minY) // Check If New Minimum { KANGlobalMinMaxCoords.minY = fVal_nw2013_VS2010; } // Z fVal_nw2013_VS2010 = (float)(array_v2.GetValue(3)); // Cast .coord 3 Value As float KANGVars.PrimitiveOutputString = KANGVars.PrimitiveOutputString + fVal_nw2013_VS2010.ToString() + "\n"; // z if (fVal_nw2013_VS2010 > KANGlobalMinMaxCoords.maxZ) // Check If New Maximum { KANGlobalMinMaxCoords.maxZ = fVal_nw2013_VS2010; } if (fVal_nw2013_VS2010 < KANGlobalMinMaxCoords.minZ) // Check If New Minimum { KANGlobalMinMaxCoords.minZ = fVal_nw2013_VS2010; } #endregion // Vertex 2 #region Vertex 3 // Array array_v3 = (Array)(object)v3.coord; // X fVal_nw2013_VS2010 = (float)(array_v3.GetValue(1)); // Cast .coord 1 Value As float KANGVars.PrimitiveOutputString = KANGVars.PrimitiveOutputString + KANGVars.strg + "," + "Vertex 3 " + ","; KANGVars.PrimitiveOutputString = KANGVars.PrimitiveOutputString + fVal_nw2013_VS2010.ToString() + ","; // x if (fVal_nw2013_VS2010 > KANGlobalMinMaxCoords.maxX) // Check If New Maximum { KANGlobalMinMaxCoords.maxX = fVal_nw2013_VS2010; } if (fVal_nw2013_VS2010 < KANGlobalMinMaxCoords.minX) // Check If New Minimum { KANGlobalMinMaxCoords.minX = fVal_nw2013_VS2010; } // Y fVal_nw2013_VS2010 = (float)(array_v3.GetValue(2)); // Cast .coord 2 Value As float KANGVars.PrimitiveOutputString = KANGVars.PrimitiveOutputString + fVal_nw2013_VS2010.ToString() + ","; // y if (fVal_nw2013_VS2010 > KANGlobalMinMaxCoords.maxY) // Check If New Maximum { KANGlobalMinMaxCoords.maxY = fVal_nw2013_VS2010; } if (fVal_nw2013_VS2010 < KANGlobalMinMaxCoords.minY) // Check If New Minimum { KANGlobalMinMaxCoords.minY = fVal_nw2013_VS2010; } // Z fVal_nw2013_VS2010 = (float)(array_v3.GetValue(3)); // Cast .coord 3 Value As float KANGVars.PrimitiveOutputString = KANGVars.PrimitiveOutputString + fVal_nw2013_VS2010.ToString() + "\n\n"; // z if (fVal_nw2013_VS2010 > KANGlobalMinMaxCoords.maxZ) // Check If New Maximum { KANGlobalMinMaxCoords.maxZ = fVal_nw2013_VS2010; } if (fVal_nw2013_VS2010 < KANGlobalMinMaxCoords.minZ) // Check If New Minimum { KANGlobalMinMaxCoords.minZ = fVal_nw2013_VS2010; } #endregion// Vertex 3 // // Result Written To File System.IO.File.AppendAllText(@".\" + KANGVars.PrimitivesFileName + ".txt", KANGVars.PrimitiveOutputString); // Reset String KANGVars.PrimitiveOutputString = ""; }
} // Unused public void SnapPoint(ComApi.InwSimpleVertex v1) { } // Unused
public void Line(ComApi.InwSimpleVertex v1, ComApi.InwSimpleVertex v2) { } // Unused
public void SnapPoint(COMApi.InwSimpleVertex v1) { }
public void Line(COMApi.InwSimpleVertex v1, COMApi.InwSimpleVertex v2) { }
public void Triangle(COMApi.InwSimpleVertex v1, COMApi.InwSimpleVertex v2, COMApi.InwSimpleVertex v3) { // do your work }
public void SnapPoint(COMApi.InwSimpleVertex v1) { // do your work }
public void Line(COMApi.InwSimpleVertex v1, COMApi.InwSimpleVertex v2) { // do your work }
public void SnapPoint(NwVertex v1) { ++SnapPointCount; }
public void Point(NwVertex v1) { ++PointCount; }
public void Line(NwVertex v1, NwVertex v2) { ++LineCount; }