Click or drag to resize

IVIZZARDServiceAddCableItem Method

Cable(Pipe) : Add

Namespace:  SHConnector
Assembly:  SHConnector (in SHConnector.dll) Version: 4.0.0.24207 (4.0.0.24207)
Syntax
C#
int AddCableItem(
	int GroupId,
	Color LineColor,
	CableShapeTypes ShapeType,
	float Radius,
	float VertexSize,
	bool Show,
	int LineCount,
	List<int> VertexCounts,
	List<float> VertexPoints
)

Parameters

GroupId
Type: SystemInt32
Group Id
LineColor
Type: System.DrawingColor
Line Color
ShapeType
Type: SHConnectorCableShapeTypes
Shape Type
Radius
Type: SystemSingle
Radius
VertexSize
Type: SystemSingle
Vertex Size
Show
Type: SystemBoolean
Show/Hide
LineCount
Type: SystemInt32
Line Count
VertexCounts
Type: System.Collections.GenericListInt32
Vertex Counts
VertexPoints
Type: System.Collections.GenericListSingle
Vertex Points

Return Value

Type: Int32
Cable id
Examples
C#
==================================================================================================================================
Shape                  |   라인                      |   사각형                      |   원                      |   정점(X)
==================================================================================================================================
Shape Id               |   0                         |   1                           |   2                       |   3
Radius                 |   선두께                    |   반지름                      |   반지름                  |   굵기
Vertext Size           |   의미 없음(0.0f)           |   의미 없음(0.0f)             |   의미 없음(0.0f)         |   크기
Line Count             |   라인 개수                 |   라인 개수                   |   라인 개수               |   정점 개수
Line 별 Vertext 개수   |   라인별 Vertext 개수       |   라인별 Vertext 개수         |   라인별 Vertext 개수     |   의미 없음
==================================================================================================================================


{
   Connector.EnableRender(false);
   int pipe1, pipe2;

   // pipe1의 라인별 Vertex 개수
   List<int> vertexCount1 = new List<int>();
   vertexCount1.Add(2);
   vertexCount1.Add(3);

   // pipe1의 전체 Vertex Point
   List<float> vertexPoints1 = new List<float>();

   // pipe1, line1, point1
   vertexPoints1.Add(19000.0f);
   vertexPoints1.Add(1420.0f);
   vertexPoints1.Add(9000.0f);

   // pipe1, line1, point2
   vertexPoints1.Add(24000.0f);
   vertexPoints1.Add(1420.0f);
   vertexPoints1.Add(9000.0f);

   // pipe1, line2, point1
   vertexPoints1.Add(19000.0f);
   vertexPoints1.Add(3420.0f);
   vertexPoints1.Add(9000.0f);

   // pipe1, line2, point2
   vertexPoints1.Add(24000.0f);
   vertexPoints1.Add(3420.0f);
   vertexPoints1.Add(9000.0f);

   // pipe1, line2, point3
   vertexPoints1.Add(24000.0f);
   vertexPoints1.Add(3420.0f);
   vertexPoints1.Add(10000.0f);


   pipe1 = Connector.AddCableItem(0, Color.Red, CableShapeTypes.Line, 3.0f, 0.0f, true, 2, vertexCount1, vertexPoints1);


   List<int> vertexCount2 = new List<int>();
   vertexCount2.Add(2);
   vertexCount2.Add(2);

   List<float> vertexPoints2 = new List<float>();
   vertexPoints2.Add(19000.0f);
   vertexPoints2.Add(5420.0f);
   vertexPoints2.Add(9000.0f);

   vertexPoints2.Add(24000.0f);
   vertexPoints2.Add(5420.0f);
   vertexPoints2.Add(9000.0f);

   vertexPoints2.Add(19000.0f);
   vertexPoints2.Add(7420.0f);
   vertexPoints2.Add(9000.0f);

   vertexPoints2.Add(24000.0f);
   vertexPoints2.Add(7420.0f);
   vertexPoints2.Add(9000.0f);


   pipe2 = Connector.AddCableItem(0, Color.Black, CableShapeTypes.Line, 7.0f, 0.0f, true, 2, vertexCount2, vertexPoints2);


   //Connector.UseCableItemDepthTest( true );    // 깊이버퍼 사용
   //Connector.DeleteCableItem( pipe1 );        // Pipe1 삭제
   //Connector.DeleteCableItemByGroupID( 0 );    // 0번그룹 삭제
   Connector.ShowAllCableItem(false);            // 모두 숨기기
   //Connector.ShowCableItem( pipe1, true );    // Pipe1번 보이기
   //Connector.ShowCableItem( pipe2, true );    // Pipe2번 보이기
   Connector.ShowCableItemByGroupID(0, true);    // 0번그룹 보이기

   Connector.EnableRender(true);
}
See Also