OLD | NEW |
1 //-***************************************************************************** | 1 //-***************************************************************************** |
2 // | 2 // |
3 // Copyright (c) 2009-2011, | 3 // Copyright (c) 2009-2011, |
4 // Sony Pictures Imageworks, Inc. and | 4 // Sony Pictures Imageworks, Inc. and |
5 // Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. | 5 // Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. |
6 // | 6 // |
7 // All rights reserved. | 7 // All rights reserved. |
8 // | 8 // |
9 // Redistribution and use in source and binary forms, with or without | 9 // Redistribution and use in source and binary forms, with or without |
10 // modification, are permitted provided that the following conditions are | 10 // modification, are permitted provided that the following conditions are |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 mat.x[2][1] = 2.0 * i; | 86 mat.x[2][1] = 2.0 * i; |
87 | 87 |
88 TESTING_ASSERT( xs.getNumOps() == 1 ); | 88 TESTING_ASSERT( xs.getNumOps() == 1 ); |
89 TESTING_ASSERT( xs[0].isMatrixOp() ); | 89 TESTING_ASSERT( xs[0].isMatrixOp() ); |
90 | 90 |
91 TESTING_ASSERT( xs.getMatrix() == mat ); | 91 TESTING_ASSERT( xs.getMatrix() == mat ); |
92 } | 92 } |
93 | 93 |
94 } | 94 } |
95 | 95 |
| 96 void rotateTest() |
| 97 { |
| 98 std::string fileName = "rotateXformOp.h"; |
| 99 { |
| 100 OArchive archive( Alembic::AbcCoreHDF5::WriteArchive(), fileName ); |
| 101 OXform a( OObject( archive, kTop ), "a" ); |
| 102 OXform b( OObject( archive, kTop ), "b" ); |
| 103 |
| 104 XformSample aSamp; |
| 105 aSamp.addOp( XformOp(kRotateOperation), V3d(0.0, 1.0, 0.0), 45.0 ); |
| 106 aSamp.addOp( XformOp(kRotateOperation), V3d(0.0, 0.0, 1.0), 30.0 ); |
| 107 aSamp.addOp( XformOp(kRotateOperation), V3d(1.0, 0.0, 0.0), 15.0 ); |
| 108 a.getSchema().set( aSamp ); |
| 109 |
| 110 XformSample bSamp; |
| 111 bSamp.addOp( XformOp(kRotateYOperation), 45.0 ); |
| 112 bSamp.addOp( XformOp(kRotateZOperation), 30.0 ); |
| 113 bSamp.addOp( XformOp(kRotateXOperation), 15.0 ); |
| 114 b.getSchema().set( bSamp ); |
| 115 } |
| 116 |
| 117 { |
| 118 IArchive archive( Alembic::AbcCoreHDF5::ReadArchive(), fileName ); |
| 119 IXform a( IObject( archive, kTop ), "a" ); |
| 120 IXform b( IObject( archive, kTop ), "b" ); |
| 121 |
| 122 M44d aMat = a.getSchema().getValue().getMatrix(); |
| 123 M44d bMat = b.getSchema().getValue().getMatrix(); |
| 124 TESTING_ASSERT( aMat == bMat ); |
| 125 } |
| 126 } |
96 | 127 |
97 //-***************************************************************************** | 128 //-***************************************************************************** |
98 int main( int argc, char *argv[] ) | 129 int main( int argc, char *argv[] ) |
99 { | 130 { |
100 xformOut(); | 131 xformOut(); |
101 xformIn(); | 132 xformIn(); |
102 | 133 |
| 134 rotateTest(); |
| 135 |
103 return 0; | 136 return 0; |
104 } | 137 } |
OLD | NEW |