File: SceneView.h

package info (click to toggle)
pymol 2.5.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 42,288 kB
  • sloc: cpp: 476,472; python: 76,538; ansic: 29,510; javascript: 6,792; sh: 47; makefile: 24
file content (30 lines) | stat: -rw-r--r-- 1,001 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once

#include "pymol/algorithm.h"

struct SceneView {
  struct ClippingPlane {
    float m_front;
    float m_back;
  };
  float m_rotMatrix[16]; /*Column major--consistent with OpenGL spec*/
  float m_pos[3];
  float m_origin[3];
  ClippingPlane m_clip;
  ClippingPlane m_clipSafe;
  bool operator==(const SceneView& other) const
  {
    return pymol::ranges::equal(m_rotMatrix, other.m_rotMatrix) &&
           pymol::ranges::equal(m_pos, other.m_pos) &&
           pymol::ranges::equal(m_origin, other.m_origin) &&
           pymol::almost_equal(m_clip.m_front, other.m_clip.m_front) &&
           pymol::almost_equal(m_clip.m_back, other.m_clip.m_back) &&
           pymol::almost_equal(m_clipSafe.m_front, other.m_clipSafe.m_front) &&
           pymol::almost_equal(m_clipSafe.m_back, other.m_clipSafe.m_back);
  }
  bool operator!=(const SceneView& other) const { return !(*this == other); }
};

constexpr std::size_t cSceneViewSize = 25u;
using SceneViewType = float[cSceneViewSize];