コード例 #1
0
        public void Unpack(BinaryReader reader)
        {
            NumPts    = reader.ReadByte();
            Stippling = (StipplingType)reader.ReadByte();

            SidesType  = (CullMode)reader.ReadInt32();
            PosSurface = reader.ReadInt16();
            NegSurface = reader.ReadInt16();

            for (short i = 0; i < NumPts; i++)
            {
                VertexIds.Add(reader.ReadInt16());
            }

            if (!Stippling.HasFlag(StipplingType.NoPos))
            {
                for (short i = 0; i < NumPts; i++)
                {
                    PosUVIndices.Add(reader.ReadByte());
                }
            }

            if (SidesType == CullMode.Clockwise && !Stippling.HasFlag(StipplingType.NoNeg))
            {
                for (short i = 0; i < NumPts; i++)
                {
                    NegUVIndices.Add(reader.ReadByte());
                }
            }

            if (SidesType == CullMode.None)
            {
                NegSurface   = PosSurface;
                NegUVIndices = PosUVIndices;
            }
        }
コード例 #2
0
        public void Unpack(BinaryReader reader)
        {
            NumPts    = reader.ReadByte();
            Stippling = reader.ReadByte();

            SidesType  = reader.ReadInt32();
            PosSurface = reader.ReadInt16();
            NegSurface = reader.ReadInt16();

            for (short i = 0; i < NumPts; i++)
            {
                VertexIds.Add(reader.ReadInt16());
            }

            if ((Stippling & 4) == 0)
            {
                for (short i = 0; i < NumPts; i++)
                {
                    PosUVIndices.Add(reader.ReadByte());
                }
            }

            if (SidesType == 2 && ((Stippling & 8) == 0))
            {
                for (short i = 0; i < NumPts; i++)
                {
                    NegUVIndices.Add(reader.ReadByte());
                }
            }

            if (SidesType == 1)
            {
                NegSurface   = PosSurface;
                NegUVIndices = PosUVIndices;
            }
        }
コード例 #3
0
 public Atom GetAtomFromName(string atomName)
 {
     return(VertexIds.Select(Molecule.GetAtom).SingleOrDefault(atom => atom.AminoAcidAtomName == atomName));
 }